diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 70da477e..e56617da 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -110,6 +110,10 @@ jobs: mkdir /tmp/ci-cache chmod 755 /tmp/ci-cache + - uses: quantinuum/hugrverse-env/install-hugrenv-action@main + with: + packages: "llvm" + # -------------------------------- # Build selene-sim wheel # -------------------------------- diff --git a/Cargo.lock b/Cargo.lock index eec3ea90..7d88a0e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "anstream" version = "1.0.0" @@ -73,6 +88,21 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link 0.2.1", +] + [[package]] name = "base64" version = "0.22.1" @@ -238,6 +268,12 @@ dependencies = [ "wasip2", ] +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + [[package]] name = "hashbrown" version = "0.17.0" @@ -413,6 +449,15 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + [[package]] name = "ntapi" version = "0.4.3" @@ -472,6 +517,15 @@ dependencies = [ "objc2-core-foundation", ] +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell_polyfill" version = "1.70.2" @@ -582,6 +636,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "rustc-demangle" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" + [[package]] name = "rustc_version" version = "0.4.1" @@ -649,12 +709,15 @@ name = "selene-sim" version = "0.3.0" dependencies = [ "anyhow", + "backtrace", + "libc", "rand", "rand_pcg", "selene-core", "serde", "serde_yml", "url", + "windows-sys", ] [[package]] diff --git a/conftest.py b/conftest.py index 30eb8a01..20ca3e22 100644 --- a/conftest.py +++ b/conftest.py @@ -55,16 +55,27 @@ def get_platform_suffix() -> str: ] -def _compile_inline_guppy_source_to_hugr_bytes(guppy_source: str) -> bytes: +def _compile_inline_guppy_source_to_hugr_bytes( + guppy_source: str, emit_debug: bool +) -> bytes: # check if guppy is installed if importlib.util.find_spec("guppylang") is None: raise RuntimeError( "Guppy is not installed. Please install guppylang to compile inline guppy source." ) + maybe_debug = ( + "" + if not emit_debug + else """ +from guppylang_internals.debug_mode import turn_on_debug_mode +turn_on_debug_mode() +""" + ) + # This executes trusted inline source defined in this repository's test files. - standalone_file = f""" -{guppy_source} + standalone_file = f"""{guppy_source} +{maybe_debug} from pathlib import Path compiled_hugr = main.compile() @@ -75,7 +86,7 @@ def _compile_inline_guppy_source_to_hugr_bytes(guppy_source: str) -> bytes: # make temporary directory import tempfile - with tempfile.TemporaryDirectory() as temp_dir: + with tempfile.TemporaryDirectory(delete=False) as temp_dir: temp_path = Path(temp_dir) / "temp_guppy_source.py" temp_path.write_text(standalone_file) # execute the file in a subprocess to avoid any issues with stateful execution of guppy code in the same process @@ -87,7 +98,7 @@ def _compile_inline_guppy_source_to_hugr_bytes(guppy_source: str) -> bytes: def _compile_hugr_to_llvm_ir_for_target( - hugr_bytes: bytes, qis_platform: str, target: str + hugr_bytes: bytes, qis_platform: str, target: str, emit_debug: bool ) -> str: try: from selene_hugr_qis_compiler import compile_to_llvm_ir @@ -96,7 +107,20 @@ def _compile_hugr_to_llvm_ir_for_target( "--compile-guppy requires selene_hugr_qis_compiler and guppylang to be installed." ) from exc - return compile_to_llvm_ir(hugr_bytes, platform=qis_platform, target_triple=target) + result = compile_to_llvm_ir( + hugr_bytes, platform=qis_platform, target_triple=target, emit_debug=emit_debug + ) + if emit_debug: + # sanitize debug file paths for reproducibility + import re + + result = re.sub( + r'filename: "[^"]+temp_guppy_source.py"', + 'filename: "/sanitized/path/program.py"', + result, + ) + result = re.sub('directory: "[^"]+"', 'directory: "/sanitized/path"', result) + return result def _hash_guppy(guppy_source: str) -> str: @@ -104,11 +128,11 @@ def _hash_guppy(guppy_source: str) -> str: def _compile_inline_guppy_source_to_llvm_ir( - guppy_source: str, *, qis_platform: str, target: str + guppy_source: str, *, qis_platform: str, target: str, emit_debug: bool ) -> str: - hugr_bytes = _compile_inline_guppy_source_to_hugr_bytes(guppy_source) + hugr_bytes = _compile_inline_guppy_source_to_hugr_bytes(guppy_source, emit_debug) return _compile_hugr_to_llvm_ir_for_target( - hugr_bytes, qis_platform=qis_platform, target=target + hugr_bytes, qis_platform=qis_platform, target=target, emit_debug=emit_debug ) @@ -119,6 +143,7 @@ def _resolve( program_name: str, guppy_source: str, qis_platform: str = "helios", + emit_debug: bool = False, ) -> Path | bytes: test_name = request.node.name test_path = Path(request.node.fspath) @@ -138,7 +163,10 @@ def _resolve( for qis_platform_it in SUPPORTED_QIS_PLATFORMS: for target in SUPPORTED_TARGETS: llvm_ir = _compile_inline_guppy_source_to_llvm_ir( - guppy_source, qis_platform=qis_platform_it, target=target + guppy_source, + qis_platform=qis_platform_it, + target=target, + emit_debug=emit_debug, ) ( resources_dir / f"{program_name}-{qis_platform_it}-{target}.ll" diff --git a/devenv.nix b/devenv.nix index 5655e262..ab22775a 100644 --- a/devenv.nix +++ b/devenv.nix @@ -1,5 +1,7 @@ { pkgs, lib, inputs, config, ... }: -{ +let + hugrenv = pkgs.callPackage ./hugrenv.nix { packages = ["llvm"]; }; +in { config = { packages = with pkgs; [ cmake @@ -17,10 +19,12 @@ enterShell = '' eval "$(just --completions bash)" export LD_LIBRARY_PATH="${lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export PATH="${hugrenv}/bin:$PATH" ''; env = { - LIBCLANG_PATH = "${pkgs.libclang.lib}"; + "LIBCLANG_PATH" = "${hugrenv}/lib"; + "HUGRENV_PATH" = "${hugrenv}"; }; diff --git a/hatch_build.py b/hatch_build.py index 0f49b681..96d0336c 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -252,6 +252,62 @@ def extract_libs(self): shutil.copy(lib_path, destination) +class HugrenvTools: + def __init__(self, hook: "BundleBuildHook") -> None: + self.hook = hook + assert "HUGRENV_PATH" in os.environ, ( + "HUGRENV_PATH environment variable is not set. This is required for bundling Hugrenv tools into selene's _dist directory." + ) + self.hugrenv_path = Path(os.environ["HUGRENV_PATH"]) + self.is_cibw_host_path = str(self.hugrenv_path).startswith("/host/") + assert self.hugrenv_path.is_dir(), ( + f"HUGRENV_PATH ('{self.hugrenv_path}') does not exist or is not a directory as required." + ) + + def resolve_artifact(self, directory: str, name: str) -> Path: + seen: set[Path] = set() + path = self.hugrenv_path / directory / name + while path.is_symlink(): + if path in seen: + raise RuntimeError(f"Symlink loop while resolving {path}") + seen.add(path) + target = path.readlink() + if target.is_absolute(): + if self.is_cibw_host_path: + target = Path("/host") / target.relative_to("/") + path = target + else: + path = Path(os.path.normpath(path.parent / target)) + return path + + def extract_artifact(self, directory: str, name: str): + artifact_path = self.resolve_artifact(directory, name) + assert artifact_path.is_file(), ( + f"Hugrenv artifact '{name}' not found at {artifact_path}" + ) + dist_dir = ( + Path(self.hook.root) / f"selene-sim/python/selene_sim/_dist/{directory}" + ) + dist_dir.mkdir(parents=True, exist_ok=True) + self.hook.app.display_info(f"Copying {artifact_path} to {dist_dir}") + shutil.copy(artifact_path, dist_dir) + dist_path = dist_dir / name + dist_path.chmod(0o755) + + def extract_binary(self, name): + if sys.platform == "win32": + name += ".exe" + self.extract_artifact("bin", name) + + def extract_library(self, name): + raise NotImplementedError("extract_library is not implemented yet.") + + def extract(self): + self.extract_binary("llvm-symbolizer") + if sys.platform == "darwin": + self.extract_binary("dsymutil") + + class BundleBuildHook(BuildHookInterface): def target_is_windows(self) -> bool: return sys.platform == "win32" or os.environ.get( @@ -290,6 +346,8 @@ def initialize(self, version: str, build_data: dict) -> None: utilities_builder = UtilitiesBuild(self) utilities_builder.build_all() utilities_builder.extract_libs() + hugrenv_tools = HugrenvTools(self) + hugrenv_tools.extract() packages = [Path("selene-sim/python/selene_sim")] for topic_dir in Path("selene-ext").iterdir(): diff --git a/hugrenv.lock b/hugrenv.lock new file mode 100644 index 00000000..08e64532 --- /dev/null +++ b/hugrenv.lock @@ -0,0 +1,31 @@ +{ + "version": "0.5.0", + "hashes": { + "macosx_11_0": { + "aarch64": { + "llvm": "sha256-vAyAnlsZcTbddA/pZZR3n1TP6ZWi2AEL9lFsfSqoGIo=", + "tket": "sha256-+YbO4aE+3HM5di09cnNpvaLKM/8yg5hvvuzQL5xCa+g=" + }, + "x86_64": { + "llvm": "sha256-yxaf4SZQFikmUfy5v3OxnKAhbCxn+xTXTwVu8GeZKrg=", + "tket": "sha256-goKko59ADWtZvlpDI4lJBuixVk/qzhafhNH/i1Ir2wQ=" + } + }, + "manylinux_2_28": { + "aarch64": { + "llvm": "sha256-f3/vh+VGPVvLDRgYUlnOaCXGKokh+seBuZ2SUN7514k=", + "tket": "sha256-BUOI/FEZ3p6XDOqKOVKWDDm5qMD5Cs2ghWxd5wXk8Nc=" + }, + "x86_64": { + "llvm": "sha256-xF5Mg5/qrnn2HtWDnp9s1RK0SeyHjgkMHWZgHKRxjIQ=", + "tket": "sha256-q5dXP1Fiq3tcHhE3lYQO9CYFoZzAPXCI5BWrT4HKrNo=" + } + }, + "win": { + "amd64": { + "llvm": "sha256-e41NcJtwyz8iqKgs0y09T123q8FIzeqe2ARuwom1Fl4=", + "tket": "sha256-bcY00WM56lsRMzgXfOgHZx/PZ4xeGT1KauMpHheAMTo=" + } + } + } +} diff --git a/hugrenv.nix b/hugrenv.nix new file mode 100644 index 00000000..f233066d --- /dev/null +++ b/hugrenv.nix @@ -0,0 +1,19 @@ +{ + pkgs ? import {}, + platform ? if pkgs.stdenv.isDarwin then "macosx_11_0" else "manylinux_2_28", + arch ? if pkgs.stdenv.isAarch64 then "aarch64" else "x86_64", + packages ? [ "tket" "llvm" ], +}: +let + sources = builtins.fromJSON (builtins.readFile ./hugrenv.lock); + version = sources.version; + get-package = package: pkgs.fetchzip { + url = let + path="https://github.com/Quantinuum/hugrverse-env/releases/download/v${version}/hugrenv-${package}-${platform}_${arch}.tar.gz"; + in builtins.trace "fetching ${package} from ${path}" path; + sha256 = sources.hashes.${platform}.${arch}.${package}; + }; +in pkgs.symlinkJoin { + name = "hugrenv-${version}-${pkgs.lib.concatStringsSep "-" [platform arch]}_${pkgs.lib.concatStringsSep "-" packages}"; + paths = map get-package packages; +} diff --git a/pyproject.toml b/pyproject.toml index 5cc1d74b..c4fec909 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -194,8 +194,11 @@ build-frontend = { name = "build[uv]", args = ["-C--profile=release"] } environment-pass = ["UV_EXTRA_INDEX_URL", "PIP_EXTRA_INDEX_URL", "CACHE_CARGO"] test-groups = ["test"] test-command = "pytest {project}/selene-sim {project}/selene-ext {project}/selene-core" +[tool.cibuildwheel.linux.environment] +PATH = "$PATH:$HOME/.cargo/bin:/host$HUGRENV_PATH" +HUGRENV_PATH = "/host$HUGRENV_PATH" [tool.cibuildwheel.linux] -environment = { PATH = "$PATH:$HOME/.cargo/bin" } +environment-pass = ["HUGRENV_PATH"] before-all = ''' # clean any non-version-controlled files, e.g. when building locally. git clean -dfX; @@ -232,13 +235,18 @@ before-test = ''' fi; uv pip install ./selene-core; ''' +[tool.cibuildwheel.macos.environment] +PATH = "$PATH:$HOME/.cargo/bin:${HUGRENV_PATH}" +MACOSX_DEPLOYMENT_TARGET = "12.0" [tool.cibuildwheel.macos] -environment = { PATH = "$PATH:$HOME/.cargo/bin", MACOSX_DEPLOYMENT_TARGET = "12.0" } before-test = [ 'uv pip install ./selene-core' ] + +[tool.cibuildwheel.windows.environment] +PATH = "$PATH:$HOME/.cargo/bin" +CARGO_BUILD_TARGET = "x86_64-pc-windows-gnu" [tool.cibuildwheel.windows] -environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_BUILD_TARGET = "x86_64-pc-windows-gnu" } before-all = [ 'curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y', 'rustup toolchain install', diff --git a/selene-ext/interfaces/helios_qis/python/selene_helios_qis_plugin/build.py b/selene-ext/interfaces/helios_qis/python/selene_helios_qis_plugin/build.py index fc8f5903..2885ec4d 100644 --- a/selene-ext/interfaces/helios_qis/python/selene_helios_qis_plugin/build.py +++ b/selene-ext/interfaces/helios_qis/python/selene_helios_qis_plugin/build.py @@ -49,7 +49,10 @@ def apply(cls, build_ctx: BuildCtx, input_artifact: Artifact) -> Artifact: "selene-hugr-qis-compiler with appropriate support for multiple QIS targets" " is required for building. Please install it via pip." ) - ir = compile_to_llvm_ir(input_artifact.resource, platform="helios") + emit_debug = build_ctx.cfg.get("debug", False) + ir = compile_to_llvm_ir( + input_artifact.resource, platform="helios", emit_debug=emit_debug + ) return cls._make_artifact(ir) @@ -82,5 +85,8 @@ def apply(cls, build_ctx: BuildCtx, input_artifact: Artifact) -> Artifact: "selene-hugr-qis-compiler with appropriate support for multiple QIS targets" " is required for building. Please install it via pip." ) - bitcode = compile_to_bitcode(input_artifact.resource, platform="helios") + emit_debug = build_ctx.cfg.get("debug", False) + bitcode = compile_to_bitcode( + input_artifact.resource, platform="helios", emit_debug=emit_debug + ) return cls._make_artifact(bitcode) diff --git a/selene-ext/interfaces/sol_qis/python/selene_sol_qis_plugin/build.py b/selene-ext/interfaces/sol_qis/python/selene_sol_qis_plugin/build.py index a981ca10..2d00bb87 100644 --- a/selene-ext/interfaces/sol_qis/python/selene_sol_qis_plugin/build.py +++ b/selene-ext/interfaces/sol_qis/python/selene_sol_qis_plugin/build.py @@ -49,7 +49,10 @@ def apply(cls, build_ctx: BuildCtx, input_artifact: Artifact) -> Artifact: "selene-hugr-qis-compiler with appropriate support for multiple QIS targets" " is required for building. Please install it via pip." ) - ir = compile_to_llvm_ir(input_artifact.resource, platform="sol") + emit_debug = build_ctx.cfg.get("debug", False) + ir = compile_to_llvm_ir( + input_artifact.resource, platform="sol", emit_debug=emit_debug + ) return cls._make_artifact(ir) @@ -82,5 +85,8 @@ def apply(cls, build_ctx: BuildCtx, input_artifact: Artifact) -> Artifact: "selene-hugr-qis-compiler with appropriate support for multiple QIS targets" " is required for building. Please install it via pip." ) - bitcode = compile_to_bitcode(input_artifact.resource, platform="sol") + emit_debug = build_ctx.cfg.get("debug", False) + bitcode = compile_to_bitcode( + input_artifact.resource, platform="sol", emit_debug=emit_debug + ) return cls._make_artifact(bitcode) diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-apple-darwin.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-apple-darwin.ll index bf34d3bd..94c894bb 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-apple-darwin.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-apple-darwin.ll @@ -3,730 +3,528 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_619_case_0.i, label %__hugr__.__tk2_helios_qalloc.615.exit -cond_652_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_619_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.625.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.615.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_helios_qalloc.625.exit.6, %__hugr__.__tk2_helios_qalloc.625.exit.5, %__hugr__.__tk2_helios_qalloc.625.exit.4, %__hugr__.__tk2_helios_qalloc.625.exit.3, %__hugr__.__tk2_helios_qalloc.625.exit.2, %__hugr__.__tk2_helios_qalloc.625.exit.1, %__hugr__.__tk2_helios_qalloc.625.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.1 - -__hugr__.__tk2_helios_qalloc.625.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.2 - -__hugr__.__tk2_helios_qalloc.625.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.3 - -__hugr__.__tk2_helios_qalloc.625.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.4 - -__hugr__.__tk2_helios_qalloc.625.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.5 - -__hugr__.__tk2_helios_qalloc.625.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.6 - -__hugr__.__tk2_helios_qalloc.625.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_652_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rxy(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rxy(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"672_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"672_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"672_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"672_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"672_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"672_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_675.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rzz(i64 %42, i64 %49, double %56) + tail call void @___rz(i64 %49, double %55) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_675.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_675.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %"672_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_675.thread.i.i - -cond_exit_675.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"672_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_675.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_675.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_675.thread.1.i.i - -cond_exit_675.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_675.thread.i.i - %147 = add i64 %"672_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_675.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_675.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_675.thread.2.i.i - -cond_exit_675.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_675.thread.1.i.i - %158 = add i64 %"672_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_675.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_675.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_675.thread.3.i.i - -cond_exit_675.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_675.thread.2.i.i - %169 = add i64 %"672_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_675.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_675.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_675.thread.4.i.i - -cond_exit_675.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_675.thread.3.i.i - %180 = add i64 %"672_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_675.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_675.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_675.thread.5.i.i - -cond_exit_675.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_675.thread.4.i.i - %191 = add i64 %"672_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_675.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_675.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_675.thread.6.i.i - -cond_exit_675.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_675.thread.5.i.i - %202 = add i64 %"672_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_675.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_675.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_675.thread.7.i.i - -cond_exit_675.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_675.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_675.thread.7.i.i - tail call void @heap_free(ptr %"672_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"672_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rzz(i64 %3, i64 %254, double %257) - tail call void @___rz(i64 %254, double %256) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_665.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_665 + +cond_exit_665: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_665.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_665 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_665.1 + +cond_exit_665.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_665 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_665.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_665.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_665.2 + +cond_exit_665.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_665.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_665.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_665.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_665.3 + +cond_exit_665.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_665.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_665.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_665.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_665.4 + +cond_exit_665.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_665.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_665.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_665.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_665.5 + +cond_exit_665.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_665.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_665.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_665.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_665.6 + +cond_exit_665.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_665.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_665.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_665.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_665.7 + +cond_exit_665.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_665.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_665, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_665.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -736,18 +534,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -773,9 +571,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-unknown-linux-gnu.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-unknown-linux-gnu.ll index 2b8ada6a..cdb09e57 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-aarch64-unknown-linux-gnu.ll @@ -3,730 +3,528 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_619_case_0.i, label %__hugr__.__tk2_helios_qalloc.615.exit -cond_652_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_619_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.625.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.615.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_helios_qalloc.625.exit.6, %__hugr__.__tk2_helios_qalloc.625.exit.5, %__hugr__.__tk2_helios_qalloc.625.exit.4, %__hugr__.__tk2_helios_qalloc.625.exit.3, %__hugr__.__tk2_helios_qalloc.625.exit.2, %__hugr__.__tk2_helios_qalloc.625.exit.1, %__hugr__.__tk2_helios_qalloc.625.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.1 - -__hugr__.__tk2_helios_qalloc.625.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.2 - -__hugr__.__tk2_helios_qalloc.625.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.3 - -__hugr__.__tk2_helios_qalloc.625.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.4 - -__hugr__.__tk2_helios_qalloc.625.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.5 - -__hugr__.__tk2_helios_qalloc.625.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.6 - -__hugr__.__tk2_helios_qalloc.625.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_652_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rxy(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rxy(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"672_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"672_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"672_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"672_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"672_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"672_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_675.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rzz(i64 %42, i64 %49, double %56) + tail call void @___rz(i64 %49, double %55) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_675.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_675.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %"672_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_675.thread.i.i - -cond_exit_675.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"672_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_675.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_675.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_675.thread.1.i.i - -cond_exit_675.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_675.thread.i.i - %147 = add i64 %"672_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_675.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_675.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_675.thread.2.i.i - -cond_exit_675.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_675.thread.1.i.i - %158 = add i64 %"672_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_675.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_675.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_675.thread.3.i.i - -cond_exit_675.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_675.thread.2.i.i - %169 = add i64 %"672_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_675.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_675.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_675.thread.4.i.i - -cond_exit_675.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_675.thread.3.i.i - %180 = add i64 %"672_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_675.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_675.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_675.thread.5.i.i - -cond_exit_675.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_675.thread.4.i.i - %191 = add i64 %"672_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_675.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_675.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_675.thread.6.i.i - -cond_exit_675.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_675.thread.5.i.i - %202 = add i64 %"672_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_675.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_675.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_675.thread.7.i.i - -cond_exit_675.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_675.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_675.thread.7.i.i - tail call void @heap_free(ptr %"672_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"672_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rzz(i64 %3, i64 %254, double %257) - tail call void @___rz(i64 %254, double %256) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_665.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_665 + +cond_exit_665: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_665.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_665 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_665.1 + +cond_exit_665.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_665 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_665.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_665.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_665.2 + +cond_exit_665.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_665.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_665.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_665.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_665.3 + +cond_exit_665.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_665.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_665.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_665.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_665.4 + +cond_exit_665.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_665.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_665.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_665.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_665.5 + +cond_exit_665.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_665.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_665.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_665.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_665.6 + +cond_exit_665.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_665.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_665.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_665.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_665.7 + +cond_exit_665.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_665.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_665, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_665.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -736,18 +534,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -773,9 +571,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-apple-darwin.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-apple-darwin.ll index 5dcff723..fba5606d 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-apple-darwin.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-apple-darwin.ll @@ -3,730 +3,528 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_619_case_0.i, label %__hugr__.__tk2_helios_qalloc.615.exit -cond_652_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_619_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.625.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.615.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_helios_qalloc.625.exit.6, %__hugr__.__tk2_helios_qalloc.625.exit.5, %__hugr__.__tk2_helios_qalloc.625.exit.4, %__hugr__.__tk2_helios_qalloc.625.exit.3, %__hugr__.__tk2_helios_qalloc.625.exit.2, %__hugr__.__tk2_helios_qalloc.625.exit.1, %__hugr__.__tk2_helios_qalloc.625.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.1 - -__hugr__.__tk2_helios_qalloc.625.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.2 - -__hugr__.__tk2_helios_qalloc.625.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.3 - -__hugr__.__tk2_helios_qalloc.625.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.4 - -__hugr__.__tk2_helios_qalloc.625.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.5 - -__hugr__.__tk2_helios_qalloc.625.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.6 - -__hugr__.__tk2_helios_qalloc.625.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_652_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rxy(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rxy(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"672_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"672_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"672_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"672_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"672_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"672_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_675.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rzz(i64 %42, i64 %49, double %56) + tail call void @___rz(i64 %49, double %55) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_675.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_675.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %"672_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_675.thread.i.i - -cond_exit_675.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"672_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_675.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_675.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_675.thread.1.i.i - -cond_exit_675.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_675.thread.i.i - %147 = add i64 %"672_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_675.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_675.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_675.thread.2.i.i - -cond_exit_675.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_675.thread.1.i.i - %158 = add i64 %"672_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_675.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_675.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_675.thread.3.i.i - -cond_exit_675.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_675.thread.2.i.i - %169 = add i64 %"672_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_675.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_675.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_675.thread.4.i.i - -cond_exit_675.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_675.thread.3.i.i - %180 = add i64 %"672_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_675.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_675.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_675.thread.5.i.i - -cond_exit_675.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_675.thread.4.i.i - %191 = add i64 %"672_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_675.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_675.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_675.thread.6.i.i - -cond_exit_675.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_675.thread.5.i.i - %202 = add i64 %"672_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_675.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_675.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_675.thread.7.i.i - -cond_exit_675.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_675.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_675.thread.7.i.i - tail call void @heap_free(ptr %"672_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"672_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rzz(i64 %3, i64 %254, double %257) - tail call void @___rz(i64 %254, double %256) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_665.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_665 + +cond_exit_665: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_665.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_665 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_665.1 + +cond_exit_665.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_665 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_665.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_665.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_665.2 + +cond_exit_665.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_665.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_665.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_665.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_665.3 + +cond_exit_665.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_665.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_665.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_665.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_665.4 + +cond_exit_665.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_665.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_665.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_665.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_665.5 + +cond_exit_665.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_665.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_665.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_665.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_665.6 + +cond_exit_665.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_665.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_665.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_665.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_665.7 + +cond_exit_665.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_665.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_665, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_665.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -736,18 +534,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -773,9 +571,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-unknown-linux-gnu.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-unknown-linux-gnu.ll index 65828047..8b8f499a 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-unknown-linux-gnu.ll @@ -3,730 +3,528 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_619_case_0.i, label %__hugr__.__tk2_helios_qalloc.615.exit -cond_652_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_619_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.625.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.615.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_helios_qalloc.625.exit.6, %__hugr__.__tk2_helios_qalloc.625.exit.5, %__hugr__.__tk2_helios_qalloc.625.exit.4, %__hugr__.__tk2_helios_qalloc.625.exit.3, %__hugr__.__tk2_helios_qalloc.625.exit.2, %__hugr__.__tk2_helios_qalloc.625.exit.1, %__hugr__.__tk2_helios_qalloc.625.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.1 - -__hugr__.__tk2_helios_qalloc.625.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.2 - -__hugr__.__tk2_helios_qalloc.625.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.3 - -__hugr__.__tk2_helios_qalloc.625.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.4 - -__hugr__.__tk2_helios_qalloc.625.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.5 - -__hugr__.__tk2_helios_qalloc.625.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.6 - -__hugr__.__tk2_helios_qalloc.625.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_652_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rxy(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rxy(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"672_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"672_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"672_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"672_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"672_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"672_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_675.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rzz(i64 %42, i64 %49, double %56) + tail call void @___rz(i64 %49, double %55) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_675.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_675.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %"672_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_675.thread.i.i - -cond_exit_675.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"672_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_675.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_675.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_675.thread.1.i.i - -cond_exit_675.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_675.thread.i.i - %147 = add i64 %"672_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_675.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_675.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_675.thread.2.i.i - -cond_exit_675.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_675.thread.1.i.i - %158 = add i64 %"672_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_675.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_675.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_675.thread.3.i.i - -cond_exit_675.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_675.thread.2.i.i - %169 = add i64 %"672_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_675.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_675.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_675.thread.4.i.i - -cond_exit_675.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_675.thread.3.i.i - %180 = add i64 %"672_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_675.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_675.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_675.thread.5.i.i - -cond_exit_675.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_675.thread.4.i.i - %191 = add i64 %"672_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_675.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_675.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_675.thread.6.i.i - -cond_exit_675.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_675.thread.5.i.i - %202 = add i64 %"672_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_675.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_675.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_675.thread.7.i.i - -cond_exit_675.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_675.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_675.thread.7.i.i - tail call void @heap_free(ptr %"672_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"672_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rzz(i64 %3, i64 %254, double %257) - tail call void @___rz(i64 %254, double %256) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_665.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_665 + +cond_exit_665: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_665.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_665 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_665.1 + +cond_exit_665.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_665 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_665.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_665.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_665.2 + +cond_exit_665.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_665.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_665.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_665.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_665.3 + +cond_exit_665.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_665.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_665.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_665.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_665.4 + +cond_exit_665.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_665.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_665.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_665.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_665.5 + +cond_exit_665.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_665.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_665.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_665.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_665.6 + +cond_exit_665.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_665.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_665.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_665.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_665.7 + +cond_exit_665.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_665.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_665, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_665.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -736,18 +534,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -773,9 +571,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-windows-gnu.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-windows-gnu.ll index ad687f75..accf270e 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-windows-gnu.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-helios-x86_64-windows-gnu.ll @@ -3,730 +3,528 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_619_case_0.i, label %__hugr__.__tk2_helios_qalloc.615.exit -cond_652_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_619_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.625.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.615.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_helios_qalloc.625.exit.6, %__hugr__.__tk2_helios_qalloc.625.exit.5, %__hugr__.__tk2_helios_qalloc.625.exit.4, %__hugr__.__tk2_helios_qalloc.625.exit.3, %__hugr__.__tk2_helios_qalloc.625.exit.2, %__hugr__.__tk2_helios_qalloc.625.exit.1, %__hugr__.__tk2_helios_qalloc.625.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.615.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.1 - -__hugr__.__tk2_helios_qalloc.625.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.2 - -__hugr__.__tk2_helios_qalloc.625.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.3 - -__hugr__.__tk2_helios_qalloc.625.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.4 - -__hugr__.__tk2_helios_qalloc.625.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.5 - -__hugr__.__tk2_helios_qalloc.625.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_652_case_0.i, label %__hugr__.__tk2_helios_qalloc.625.exit.6 - -__hugr__.__tk2_helios_qalloc.625.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.625.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_652_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rxy(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rxy(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"672_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"672_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"672_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"672_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"672_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"672_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_675.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rzz(i64 %42, i64 %49, double %56) + tail call void @___rz(i64 %49, double %55) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_675.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_675.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %"672_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_675.thread.i.i - -cond_exit_675.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"672_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_675.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_675.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_675.thread.1.i.i - -cond_exit_675.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_675.thread.i.i - %147 = add i64 %"672_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_675.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_675.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_675.thread.2.i.i - -cond_exit_675.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_675.thread.1.i.i - %158 = add i64 %"672_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_675.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_675.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_675.thread.3.i.i - -cond_exit_675.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_675.thread.2.i.i - %169 = add i64 %"672_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_675.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_675.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_675.thread.4.i.i - -cond_exit_675.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_675.thread.3.i.i - %180 = add i64 %"672_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_675.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_675.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_675.thread.5.i.i - -cond_exit_675.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_675.thread.4.i.i - %191 = add i64 %"672_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_675.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_675.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_675.thread.6.i.i - -cond_exit_675.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_675.thread.5.i.i - %202 = add i64 %"672_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"672_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_675.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_675.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"672_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_675.thread.7.i.i - -cond_exit_675.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_675.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_675.thread.7.i.i - tail call void @heap_free(ptr %"672_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"672_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rzz(i64 %3, i64 %254, double %257) - tail call void @___rz(i64 %254, double %256) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_665.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_665 + +cond_exit_665: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_665.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_665 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_665.1 + +cond_exit_665.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_665 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_665.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_665.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_665.2 + +cond_exit_665.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_665.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_665.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_665.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_665.3 + +cond_exit_665.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_665.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_665.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_665.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_665.4 + +cond_exit_665.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_665.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_665.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_665.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_665.5 + +cond_exit_665.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_665.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_665.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_665.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_665.6 + +cond_exit_665.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_665.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_665.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_665.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_665.7 + +cond_exit_665.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_665.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_665, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_665.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -736,18 +534,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -773,9 +571,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-apple-darwin.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-apple-darwin.ll index 62b2fdf2..3fec80ad 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-apple-darwin.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-apple-darwin.ll @@ -3,734 +3,532 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_631_case_0.i, label %__hugr__.__tk2_sol_qalloc.627.exit -cond_664_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_631_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.637.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.627.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_sol_qalloc.637.exit.6, %__hugr__.__tk2_sol_qalloc.637.exit.5, %__hugr__.__tk2_sol_qalloc.637.exit.4, %__hugr__.__tk2_sol_qalloc.637.exit.3, %__hugr__.__tk2_sol_qalloc.637.exit.2, %__hugr__.__tk2_sol_qalloc.637.exit.1, %__hugr__.__tk2_sol_qalloc.637.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.1 - -__hugr__.__tk2_sol_qalloc.637.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.2 - -__hugr__.__tk2_sol_qalloc.637.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.3 - -__hugr__.__tk2_sol_qalloc.637.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.4 - -__hugr__.__tk2_sol_qalloc.637.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.5 - -__hugr__.__tk2_sol_qalloc.637.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.6 - -__hugr__.__tk2_sol_qalloc.637.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_664_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rp(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rp(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"684_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"684_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"684_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"684_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"684_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"684_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_687.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rpp(i64 %42, i64 %49, double %56, double 0xC00921FB54442D18) + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %49, double %55) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_687.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_687.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %"684_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_687.thread.i.i - -cond_exit_687.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"684_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_687.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_687.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_687.thread.1.i.i - -cond_exit_687.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_687.thread.i.i - %147 = add i64 %"684_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_687.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_687.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_687.thread.2.i.i - -cond_exit_687.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_687.thread.1.i.i - %158 = add i64 %"684_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_687.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_687.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_687.thread.3.i.i - -cond_exit_687.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_687.thread.2.i.i - %169 = add i64 %"684_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_687.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_687.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_687.thread.4.i.i - -cond_exit_687.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_687.thread.3.i.i - %180 = add i64 %"684_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_687.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_687.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_687.thread.5.i.i - -cond_exit_687.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_687.thread.4.i.i - %191 = add i64 %"684_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_687.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_687.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_687.thread.6.i.i - -cond_exit_687.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_687.thread.5.i.i - %202 = add i64 %"684_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_687.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_687.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_687.thread.7.i.i - -cond_exit_687.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_687.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_687.thread.7.i.i - tail call void @heap_free(ptr %"684_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"684_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rpp(i64 %3, i64 %254, double %257, double 0xC00921FB54442D18) - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %254, double %256) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_677.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_677 + +cond_exit_677: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_677.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_677 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_677.1 + +cond_exit_677.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_677 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_677.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_677.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_677.2 + +cond_exit_677.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_677.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_677.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_677.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_677.3 + +cond_exit_677.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_677.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_677.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_677.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_677.4 + +cond_exit_677.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_677.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_677.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_677.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_677.5 + +cond_exit_677.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_677.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_677.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_677.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_677.6 + +cond_exit_677.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_677.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_677.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_677.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_677.7 + +cond_exit_677.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_677.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_677, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_677.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -740,18 +538,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -777,9 +575,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-unknown-linux-gnu.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-unknown-linux-gnu.ll index 894b9396..9610ca6e 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-aarch64-unknown-linux-gnu.ll @@ -3,734 +3,532 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_631_case_0.i, label %__hugr__.__tk2_sol_qalloc.627.exit -cond_664_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_631_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.637.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.627.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_sol_qalloc.637.exit.6, %__hugr__.__tk2_sol_qalloc.637.exit.5, %__hugr__.__tk2_sol_qalloc.637.exit.4, %__hugr__.__tk2_sol_qalloc.637.exit.3, %__hugr__.__tk2_sol_qalloc.637.exit.2, %__hugr__.__tk2_sol_qalloc.637.exit.1, %__hugr__.__tk2_sol_qalloc.637.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.1 - -__hugr__.__tk2_sol_qalloc.637.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.2 - -__hugr__.__tk2_sol_qalloc.637.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.3 - -__hugr__.__tk2_sol_qalloc.637.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.4 - -__hugr__.__tk2_sol_qalloc.637.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.5 - -__hugr__.__tk2_sol_qalloc.637.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.6 - -__hugr__.__tk2_sol_qalloc.637.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_664_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rp(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rp(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"684_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"684_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"684_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"684_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"684_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"684_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_687.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rpp(i64 %42, i64 %49, double %56, double 0xC00921FB54442D18) + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %49, double %55) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_687.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_687.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %"684_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_687.thread.i.i - -cond_exit_687.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"684_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_687.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_687.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_687.thread.1.i.i - -cond_exit_687.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_687.thread.i.i - %147 = add i64 %"684_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_687.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_687.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_687.thread.2.i.i - -cond_exit_687.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_687.thread.1.i.i - %158 = add i64 %"684_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_687.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_687.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_687.thread.3.i.i - -cond_exit_687.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_687.thread.2.i.i - %169 = add i64 %"684_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_687.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_687.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_687.thread.4.i.i - -cond_exit_687.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_687.thread.3.i.i - %180 = add i64 %"684_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_687.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_687.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_687.thread.5.i.i - -cond_exit_687.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_687.thread.4.i.i - %191 = add i64 %"684_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_687.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_687.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_687.thread.6.i.i - -cond_exit_687.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_687.thread.5.i.i - %202 = add i64 %"684_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_687.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_687.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_687.thread.7.i.i - -cond_exit_687.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_687.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_687.thread.7.i.i - tail call void @heap_free(ptr %"684_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"684_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rpp(i64 %3, i64 %254, double %257, double 0xC00921FB54442D18) - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %254, double %256) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_677.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_677 + +cond_exit_677: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_677.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_677 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_677.1 + +cond_exit_677.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_677 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_677.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_677.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_677.2 + +cond_exit_677.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_677.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_677.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_677.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_677.3 + +cond_exit_677.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_677.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_677.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_677.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_677.4 + +cond_exit_677.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_677.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_677.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_677.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_677.5 + +cond_exit_677.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_677.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_677.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_677.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_677.6 + +cond_exit_677.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_677.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_677.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_677.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_677.7 + +cond_exit_677.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_677.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_677, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_677.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -740,18 +538,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -777,9 +575,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-apple-darwin.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-apple-darwin.ll index cb3ebb7c..c88aaf4d 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-apple-darwin.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-apple-darwin.ll @@ -3,734 +3,532 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_631_case_0.i, label %__hugr__.__tk2_sol_qalloc.627.exit -cond_664_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_631_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.637.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.627.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_sol_qalloc.637.exit.6, %__hugr__.__tk2_sol_qalloc.637.exit.5, %__hugr__.__tk2_sol_qalloc.637.exit.4, %__hugr__.__tk2_sol_qalloc.637.exit.3, %__hugr__.__tk2_sol_qalloc.637.exit.2, %__hugr__.__tk2_sol_qalloc.637.exit.1, %__hugr__.__tk2_sol_qalloc.637.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.1 - -__hugr__.__tk2_sol_qalloc.637.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.2 - -__hugr__.__tk2_sol_qalloc.637.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.3 - -__hugr__.__tk2_sol_qalloc.637.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.4 - -__hugr__.__tk2_sol_qalloc.637.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.5 - -__hugr__.__tk2_sol_qalloc.637.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.6 - -__hugr__.__tk2_sol_qalloc.637.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_664_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rp(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rp(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"684_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"684_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"684_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"684_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"684_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"684_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_687.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rpp(i64 %42, i64 %49, double %56, double 0xC00921FB54442D18) + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %49, double %55) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_687.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_687.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %"684_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_687.thread.i.i - -cond_exit_687.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"684_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_687.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_687.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_687.thread.1.i.i - -cond_exit_687.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_687.thread.i.i - %147 = add i64 %"684_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_687.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_687.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_687.thread.2.i.i - -cond_exit_687.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_687.thread.1.i.i - %158 = add i64 %"684_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_687.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_687.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_687.thread.3.i.i - -cond_exit_687.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_687.thread.2.i.i - %169 = add i64 %"684_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_687.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_687.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_687.thread.4.i.i - -cond_exit_687.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_687.thread.3.i.i - %180 = add i64 %"684_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_687.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_687.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_687.thread.5.i.i - -cond_exit_687.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_687.thread.4.i.i - %191 = add i64 %"684_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_687.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_687.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_687.thread.6.i.i - -cond_exit_687.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_687.thread.5.i.i - %202 = add i64 %"684_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_687.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_687.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_687.thread.7.i.i - -cond_exit_687.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_687.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_687.thread.7.i.i - tail call void @heap_free(ptr %"684_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"684_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rpp(i64 %3, i64 %254, double %257, double 0xC00921FB54442D18) - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %254, double %256) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_677.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_677 + +cond_exit_677: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_677.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_677 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_677.1 + +cond_exit_677.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_677 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_677.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_677.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_677.2 + +cond_exit_677.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_677.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_677.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_677.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_677.3 + +cond_exit_677.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_677.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_677.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_677.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_677.4 + +cond_exit_677.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_677.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_677.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_677.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_677.5 + +cond_exit_677.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_677.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_677.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_677.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_677.6 + +cond_exit_677.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_677.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_677.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_677.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_677.7 + +cond_exit_677.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_677.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_677, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_677.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -740,18 +538,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -777,9 +575,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-unknown-linux-gnu.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-unknown-linux-gnu.ll index 608a8350..92817015 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-unknown-linux-gnu.ll @@ -3,734 +3,532 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_631_case_0.i, label %__hugr__.__tk2_sol_qalloc.627.exit -cond_664_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_631_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.637.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.627.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_sol_qalloc.637.exit.6, %__hugr__.__tk2_sol_qalloc.637.exit.5, %__hugr__.__tk2_sol_qalloc.637.exit.4, %__hugr__.__tk2_sol_qalloc.637.exit.3, %__hugr__.__tk2_sol_qalloc.637.exit.2, %__hugr__.__tk2_sol_qalloc.637.exit.1, %__hugr__.__tk2_sol_qalloc.637.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.1 - -__hugr__.__tk2_sol_qalloc.637.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.2 - -__hugr__.__tk2_sol_qalloc.637.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.3 - -__hugr__.__tk2_sol_qalloc.637.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.4 - -__hugr__.__tk2_sol_qalloc.637.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.5 - -__hugr__.__tk2_sol_qalloc.637.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.6 - -__hugr__.__tk2_sol_qalloc.637.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_664_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rp(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rp(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"684_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"684_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"684_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"684_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"684_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"684_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_687.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rpp(i64 %42, i64 %49, double %56, double 0xC00921FB54442D18) + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %49, double %55) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_687.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_687.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %"684_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_687.thread.i.i - -cond_exit_687.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"684_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_687.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_687.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_687.thread.1.i.i - -cond_exit_687.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_687.thread.i.i - %147 = add i64 %"684_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_687.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_687.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_687.thread.2.i.i - -cond_exit_687.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_687.thread.1.i.i - %158 = add i64 %"684_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_687.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_687.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_687.thread.3.i.i - -cond_exit_687.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_687.thread.2.i.i - %169 = add i64 %"684_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_687.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_687.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_687.thread.4.i.i - -cond_exit_687.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_687.thread.3.i.i - %180 = add i64 %"684_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_687.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_687.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_687.thread.5.i.i - -cond_exit_687.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_687.thread.4.i.i - %191 = add i64 %"684_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_687.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_687.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_687.thread.6.i.i - -cond_exit_687.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_687.thread.5.i.i - %202 = add i64 %"684_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_687.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_687.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_687.thread.7.i.i - -cond_exit_687.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_687.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_687.thread.7.i.i - tail call void @heap_free(ptr %"684_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"684_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rpp(i64 %3, i64 %254, double %257, double 0xC00921FB54442D18) - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %254, double %256) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_677.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_677 + +cond_exit_677: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_677.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_677 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_677.1 + +cond_exit_677.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_677 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_677.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_677.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_677.2 + +cond_exit_677.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_677.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_677.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_677.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_677.3 + +cond_exit_677.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_677.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_677.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_677.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_677.4 + +cond_exit_677.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_677.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_677.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_677.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_677.5 + +cond_exit_677.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_677.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_677.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_677.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_677.6 + +cond_exit_677.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_677.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_677.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_677.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_677.7 + +cond_exit_677.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_677.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_677, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_677.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -740,18 +538,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -777,9 +575,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-windows-gnu.ll b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-windows-gnu.ll index 61ef6b32..2b3f993c 100644 --- a/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-windows-gnu.ll +++ b/selene-ext/runtimes/soft_rz/python/tests/resources/from_guppy/test_batching/test_batching_behaviour/qft_8qb-sol-x86_64-windows-gnu.ll @@ -3,734 +3,532 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_measuremen.F30240EB.0 = private constant [26 x i8] c"\19USER:BOOLARR:measurements" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 64) + %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 64) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 64) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_278, %alloca_block + %"274_2.0" = phi i64 [ 0, %alloca_block ], [ %"2106.0", %cond_exit_278 ] + %"274_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_278 ] + %6 = icmp samesign ugt i64 %"274_0.sroa.0.0", 7 + %7 = add nuw nsw i64 %"274_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_278, label %cond_278_case_1 + +cond_278_case_1: ; preds = %loop_body + %8 = add i64 %"274_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit - -cond_exit_173.loopexit: ; preds = %__barray_mask_return.exit771 - %indvars.iv.next = add nsw i64 %indvars.iv, -1 - %exitcond806.not = icmp eq i64 %39, 8 - br i1 %exitcond806.not, label %cond_exit_89, label %__barray_check_bounds.exit728 - -cond_188_case_1: ; preds = %__barray_check_bounds.exit757 - %2 = xor i64 %245, %43 - store i64 %2, ptr %1, align 4 - %3 = load i64, ptr %45, align 4 - br label %pow.i - -pow.i: ; preds = %cond_188_case_1, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %cond_188_case_1 ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"45_0.0802", %cond_188_case_1 ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - i64 0, label %__hugr__.guppylang.std.num.int.__pow__.413.exit - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit: ; preds = %pow.i - %4 = sitofp i64 %storemerge53.i to double - br label %__hugr__.guppylang.std.num.int.__pow__.413.exit - -__hugr__.guppylang.std.num.int.__pow__.413.exit: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit - %storemerge55.i = phi double [ %4, %__hugr__.guppylang.std.num.int.__pow__.413.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %5 = fdiv double 1.000000e+00, %storemerge55.i - %6 = tail call double @llvm.fabs.f64(double %5) - %7 = fcmp ueq double %6, 0x7FF0000000000000 - br i1 %7, label %248, label %__barray_check_bounds.exit761 + br i1 %not_max.not.not.i, label %cond_631_case_0.i, label %__hugr__.__tk2_sol_qalloc.627.exit -cond_664_case_0.i: ; preds = %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_631_case_0.i: ; preds = %cond_278_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.637.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.627.exit: ; preds = %cond_278_case_1 tail call void @___reset(i64 %qalloc.i) - %8 = load i64, ptr %1, align 4 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"274_2.0", 8 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -panic.i: ; preds = %__barray_check_bounds.exit.7, %__hugr__.__tk2_sol_qalloc.637.exit.6, %__hugr__.__tk2_sol_qalloc.637.exit.5, %__hugr__.__tk2_sol_qalloc.637.exit.4, %__hugr__.__tk2_sol_qalloc.637.exit.3, %__hugr__.__tk2_sol_qalloc.637.exit.2, %__hugr__.__tk2_sol_qalloc.637.exit.1, %__hugr__.__tk2_sol_qalloc.637.exit +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.627.exit + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"274_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit - %10 = and i64 %8, -2 - store i64 %10, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.1 - -__hugr__.__tk2_sol_qalloc.637.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %11 = load i64, ptr %1, align 4 - %12 = and i64 %11, 2 - %.not807 = icmp eq i64 %12, 0 - br i1 %.not807, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.1 - %13 = and i64 %11, -3 - store i64 %13, ptr %1, align 4 - %14 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %14, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.2 - -__hugr__.__tk2_sol_qalloc.637.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %15 = load i64, ptr %1, align 4 - %16 = and i64 %15, 4 - %.not808 = icmp eq i64 %16, 0 - br i1 %.not808, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.2 - %17 = and i64 %15, -5 - store i64 %17, ptr %1, align 4 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %18, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.3 - -__hugr__.__tk2_sol_qalloc.637.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %19 = load i64, ptr %1, align 4 - %20 = and i64 %19, 8 - %.not809 = icmp eq i64 %20, 0 - br i1 %.not809, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.3 - %21 = and i64 %19, -9 - store i64 %21, ptr %1, align 4 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %22, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.4 - -__hugr__.__tk2_sol_qalloc.637.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %23 = load i64, ptr %1, align 4 - %24 = and i64 %23, 16 - %.not810 = icmp eq i64 %24, 0 - br i1 %.not810, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.4 - %25 = and i64 %23, -17 - store i64 %25, ptr %1, align 4 - %26 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %26, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.5 - -__hugr__.__tk2_sol_qalloc.637.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %27 = load i64, ptr %1, align 4 - %28 = and i64 %27, 32 - %.not811 = icmp eq i64 %28, 0 - br i1 %.not811, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.5 - %29 = and i64 %27, -33 - store i64 %29, ptr %1, align 4 - %30 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %30, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_664_case_0.i, label %__hugr__.__tk2_sol_qalloc.637.exit.6 - -__hugr__.__tk2_sol_qalloc.637.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 64 - %.not812 = icmp eq i64 %32, 0 - br i1 %.not812, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.637.exit.6 - %33 = and i64 %31, -65 - store i64 %33, ptr %1, align 4 - %34 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %34, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_664_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 128 - %.not813 = icmp eq i64 %36, 0 - br i1 %.not813, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %37 = and i64 %35, -129 - store i64 %37, ptr %1, align 4 - %38 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %38, align 4 - br label %__barray_check_bounds.exit728 - -__barray_check_bounds.exit728: ; preds = %cond_exit_173.loopexit, %cond_exit_20.7 - %indvars.iv = phi i64 [ 7, %cond_exit_20.7 ], [ %indvars.iv.next, %cond_exit_173.loopexit ] - %"45_0.0802" = phi i64 [ 0, %cond_exit_20.7 ], [ %39, %cond_exit_173.loopexit ] - %smax = tail call i64 @llvm.smax.i64(i64 %indvars.iv, i64 1) - %39 = add nuw nsw i64 %"45_0.0802", 1 - %40 = load i64, ptr %1, align 4 - %41 = lshr i64 %40, %"45_0.0802" - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i729, label %__barray_check_bounds.exit731 - -panic.i729: ; preds = %__barray_check_bounds.exit728 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"274_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"274_2.0" + store i64 %qalloc.i, ptr %15, align 4 + br label %cond_exit_278 + +cond_exit_278: ; preds = %loop_body, %__barray_mask_return.exit + %"2106.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"274_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 9 + br i1 %exitcond, label %__barray_check_bounds.exit1586, label %loop_body + +loop_out.loopexit: ; preds = %__barray_mask_return.exit1611, %__barray_mask_return.exit1591 + %16 = add nuw nsw i64 %17, 1 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %exitcond1674 = icmp eq i64 %16, 9 + br i1 %exitcond1674, label %cond_exit_374, label %__barray_check_bounds.exit1586 + +__barray_check_bounds.exit1586: ; preds = %cond_exit_278, %loop_out.loopexit + %indvars.iv = phi i64 [ %indvars.iv.next, %loop_out.loopexit ], [ 8, %cond_exit_278 ] + %17 = phi i64 [ %16, %loop_out.loopexit ], [ 1, %cond_exit_278 ] + %"6_0.01668" = phi i64 [ %17, %loop_out.loopexit ], [ 0, %cond_exit_278 ] + %18 = load i64, ptr %5, align 4 + %19 = lshr i64 %18, %"6_0.01668" + %20 = trunc i64 %19 to i1 + br i1 %20, label %panic.i1587, label %__barray_check_bounds.exit1589 + +panic.i1587: ; preds = %__barray_check_bounds.exit1586 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit731: ; preds = %__barray_check_bounds.exit728 - %43 = shl nuw nsw i64 1, %"45_0.0802" - %44 = xor i64 %40, %43 - store i64 %44, ptr %1, align 4 - %45 = getelementptr inbounds nuw i64, ptr %0, i64 %"45_0.0802" - %46 = load i64, ptr %45, align 4 - tail call void @___rp(i64 %46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %46, double 0x400921FB54442D18) - %47 = load i64, ptr %1, align 4 - %48 = lshr i64 %47, %"45_0.0802" - %49 = trunc i64 %48 to i1 - br i1 %49, label %__barray_mask_return.exit733, label %panic.i732 - -panic.i732: ; preds = %__barray_check_bounds.exit731 +__barray_check_bounds.exit1589: ; preds = %__barray_check_bounds.exit1586 + %21 = shl nuw nsw i64 1, %"6_0.01668" + %22 = xor i64 %18, %21 + store i64 %22, ptr %5, align 4 + %23 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01668" + %24 = load i64, ptr %23, align 4 + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + %25 = load i64, ptr %5, align 4 + %26 = lshr i64 %25, %"6_0.01668" + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1591, label %panic.i1590 + +panic.i1590: ; preds = %__barray_check_bounds.exit1589 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit733: ; preds = %__barray_check_bounds.exit731 - %50 = xor i64 %47, %43 - store i64 %50, ptr %1, align 4 - store i64 %46, ptr %45, align 4 - %.not803 = icmp eq i64 %"45_0.0802", 7 - br i1 %.not803, label %cond_exit_89, label %__barray_check_bounds.exit757 - -cond_exit_89: ; preds = %__barray_mask_return.exit733, %cond_exit_173.loopexit - %"45_368.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"45_368.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.0.insert", ptr %1, 1 - %"45_368.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"45_368.fca.1.insert", i64 0, 2 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 128 - %.not = icmp eq i64 %52, 0 - br i1 %.not, label %__barray_mask_borrow.exit735, label %panic.i734 - -panic.i734: ; preds = %cond_exit_89 +__barray_mask_return.exit1591: ; preds = %__barray_check_bounds.exit1589 + %28 = xor i64 %25, %21 + store i64 %28, ptr %5, align 4 + store i64 %24, ptr %23, align 4 + %.not1666.not = icmp eq i64 %"6_0.01668", 7 + br i1 %.not1666.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +cond_exit_374: ; preds = %loop_out.loopexit + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 128 + %.not1663 = icmp eq i64 %30, 0 + br i1 %.not1663, label %__barray_mask_borrow.exit1593, label %panic.i1592 + +panic.i1592: ; preds = %cond_exit_374 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit735: ; preds = %cond_exit_89 - %53 = or disjoint i64 %51, 128 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %38, align 4 - tail call void @___rp(i64 %54, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %54, double 0x400921FB54442D18) - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 128 - %.not794 = icmp eq i64 %56, 0 - br i1 %.not794, label %panic.i736, label %__barray_mask_return.exit737 - -panic.i736: ; preds = %__barray_mask_borrow.exit735 +__barray_mask_borrow.exit1593: ; preds = %cond_exit_374 + %31 = or disjoint i64 %29, 128 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 128 + %.not1664 = icmp eq i64 %35, 0 + br i1 %.not1664, label %panic.i1594, label %__barray_mask_return.exit1595 + +panic.i1594: ; preds = %__barray_mask_borrow.exit1593 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit737: ; preds = %__barray_mask_borrow.exit735 - %57 = and i64 %55, -129 - store i64 %57, ptr %1, align 4 - store i64 %54, ptr %38, align 4 - %58 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"45_368.fca.2.insert", 0 - %59 = tail call ptr @heap_alloc(i64 64) - %60 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %60, align 1 - br label %__barray_check_bounds.exit.i.i - -61: ; preds = %loop_body.i - %62 = lshr i64 %.fca.2.extract.i.i, 6 - %63 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %62 - %64 = load i64, ptr %63, align 4 - %65 = and i64 %.fca.2.extract.i.i, 63 - %66 = sub nuw nsw i64 64, %65 - %67 = lshr i64 -1, %66 - %68 = icmp eq i64 %65, 0 - %69 = select i1 %68, i64 0, i64 %67 - %70 = or i64 %64, %69 - store i64 %70, ptr %63, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 7 - %71 = lshr i64 %last_valid.i.i.i, 6 - %72 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %last_valid.i.i.i, 63 - %75 = shl nsw i64 -2, %74 - %76 = icmp eq i64 %74, 63 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %73, %77 - store i64 %78, ptr %72, align 4 - %reass.sub.i.i.i = sub nsw i64 %71, %62 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -79: ; preds = %mask_block_ok.i.i.i - %80 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %61, %79 - %.02.i.i.i = phi i64 [ %80, %79 ], [ 0, %61 ] - %gep.i.i.i = getelementptr i64, ptr %63, i64 %.02.i.i.i - %81 = load i64, ptr %gep.i.i.i, align 4 - %82 = icmp eq i64 %81, -1 - br i1 %82, label %79, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1595: ; preds = %__barray_mask_borrow.exit1593 + %36 = and i64 %34, -129 + store i64 %36, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + br label %__barray_check_bounds.exit1617 + +__barray_check_bounds.exit1597: ; preds = %__barray_mask_return.exit1591, %__barray_mask_return.exit1611 + %37 = phi i64 [ %65, %__barray_mask_return.exit1611 ], [ 1, %__barray_mask_return.exit1591 ] + %"107_3.01667" = phi i64 [ %37, %__barray_mask_return.exit1611 ], [ 0, %__barray_mask_return.exit1591 ] + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %"6_0.01668" + %40 = trunc i64 %39 to i1 + br i1 %40, label %panic.i1598, label %__barray_check_bounds.exit1601 + +panic.i1598: ; preds = %__barray_check_bounds.exit1597 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit737 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %__barray_mask_return.exit737 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %__barray_mask_return.exit737 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"349_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit737 ], [ %83, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %58, %__barray_mask_return.exit737 ], [ %98, %loop_body.i ] - %83 = add nuw nsw i64 %"349_0.sroa.15.0178.i", 1 - %84 = add i64 %"349_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %85 = lshr i64 %84, 6 - %86 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %85 - %87 = load i64, ptr %86, align 4 - %88 = and i64 %84, 63 - %89 = lshr i64 %87, %88 - %90 = trunc i64 %89 to i1 - br i1 %90, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +__barray_check_bounds.exit1601: ; preds = %__barray_check_bounds.exit1597 + %41 = xor i64 %38, %21 + store i64 %41, ptr %5, align 4 + %42 = load i64, ptr %23, align 4 + %43 = sub nuw nsw i64 7, %"107_3.01667" + %44 = lshr i64 %41, %43 + %45 = trunc i64 %44 to i1 + br i1 %45, label %panic.i1602, label %__barray_mask_borrow.exit1603 + +panic.i1602: ; preds = %__barray_check_bounds.exit1601 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %91 = shl nuw i64 1, %88 - %92 = xor i64 %91, %87 - store i64 %92, ptr %86, align 4 - %93 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %84 - %94 = load i64, ptr %93, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %60, align 4 - %96 = lshr i64 %95, %"349_0.sroa.15.0178.i" - %97 = trunc i64 %96 to i1 - br i1 %97, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit1603: ; preds = %__barray_check_bounds.exit1601 + %46 = shl nuw nsw i64 1, %43 + %47 = xor i64 %41, %46 + store i64 %47, ptr %5, align 4 + %48 = getelementptr inbounds nuw i64, ptr %4, i64 %43 + %49 = load i64, ptr %48, align 4 + br label %pow + +pow: ; preds = %pow_body, %__barray_mask_borrow.exit1603 + %storemerge1584 = phi i64 [ 2, %__barray_mask_borrow.exit1603 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"6_0.01668", %__barray_mask_borrow.exit1603 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %done + ] -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %98 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %83, 1 - %99 = shl nuw nsw i64 1, %"349_0.sroa.15.0178.i" - %100 = xor i64 %95, %99 - store i64 %100, ptr %60, align 4 - %101 = getelementptr inbounds nuw i64, ptr %59, i64 %"349_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %101, align 4 - %102 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %102, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %102, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %102, 2 - %exitcond.not.i = icmp eq i64 %83, 8 - br i1 %exitcond.not.i, label %61, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$8.335.exit": ; preds = %79, %61 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %59, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %60, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %103 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %104 = tail call ptr @heap_alloc(i64 8) - %105 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %105, align 1 - br label %__barray_check_bounds.exit.i.i738 - -loop_body.preheader.i.i: ; preds = %loop_body.i741 - %"684_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 2 - %"684_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 1 - %"684_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %232, 0 - %106 = lshr i64 %"684_1.sroa.10.0.i.i", 6 - %107 = getelementptr i64, ptr %"684_1.sroa.5.0.i.i", i64 %106 - %108 = load i64, ptr %107, align 4 - %109 = and i64 %"684_1.sroa.10.0.i.i", 63 - %110 = lshr i64 %108, %109 - %111 = trunc i64 %110 to i1 - br i1 %111, label %cond_exit_687.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i738: ; preds = %loop_body.i741, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" - %112 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %232, %loop_body.i741 ] - %"308_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %113, %loop_body.i741 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %103, %"__hugr__.guppylang.std.quantum.measure_array$8.335.exit" ], [ %228, %loop_body.i741 ] - %113 = add nuw nsw i64 %"308_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %112, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %112, 1 - %114 = add i64 %.fca.2.extract208.i.i, %"308_0.sroa.15.0168.i" - %115 = lshr i64 %114, 6 - %116 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %115 - %117 = load i64, ptr %116, align 4 - %118 = and i64 %114, 63 - %119 = lshr i64 %117, %118 - %120 = trunc i64 %119 to i1 - br i1 %120, label %panic.i.i.i753, label %__barray_check_bounds.exit221.i.i +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1584, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow -panic.i.i.i753: ; preds = %__barray_check_bounds.exit.i.i738 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +done.loopexit: ; preds = %pow + %50 = sitofp i64 %storemerge1584 to double + br label %done + +done: ; preds = %pow, %done.loopexit + %storemerge1671 = phi double [ %50, %done.loopexit ], [ 1.000000e+00, %pow ] + %reciprocal = fdiv double 1.000000e+00, %storemerge1671 + %51 = tail call double @llvm.fabs.f64(double %reciprocal) + %52 = fcmp ueq double %51, 0x7FF0000000000000 + br i1 %52, label %53, label %__barray_check_bounds.exit1605 + +53: ; preds = %done + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i738 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %112, 0 - %121 = shl nuw i64 1, %118 - %122 = xor i64 %121, %117 - store i64 %122, ptr %116, align 4 - %123 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %114 - %124 = load i64, ptr %123, align 4 - tail call void @___inc_future_refcount(i64 %124) - %125 = load i64, ptr %116, align 4 - %126 = lshr i64 %125, %118 - %127 = trunc i64 %126 to i1 - br i1 %127, label %__barray_check_bounds.exit.i739, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1605: ; preds = %done + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + %54 = fmul double %reciprocal, 0x400921FB54442D18 + %55 = fmul double %54, 5.000000e-01 + %56 = fneg double %55 + tail call void @___rpp(i64 %42, i64 %49, double %56, double 0xC00921FB54442D18) + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %49, double %55) + tail call void @___rp(i64 %42, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + %57 = load i64, ptr %5, align 4 + %58 = lshr i64 %57, %"6_0.01668" + %59 = trunc i64 %58 to i1 + br i1 %59, label %__barray_check_bounds.exit1609, label %panic.i1606 + +panic.i1606: ; preds = %__barray_check_bounds.exit1605 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -128: ; preds = %mask_block_ok.i.i.i745 - %129 = add nuw i64 %.02.i.i.i746, 1 - %exitcond.not.i.i.i749 = icmp eq i64 %.02.i.i.i746, %reass.sub.i.i.i743 - br i1 %exitcond.not.i.i.i749, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 +__barray_check_bounds.exit1609: ; preds = %__barray_check_bounds.exit1605 + %60 = xor i64 %57, %21 + store i64 %60, ptr %5, align 4 + store i64 %42, ptr %23, align 4 + %61 = load i64, ptr %5, align 4 + %62 = lshr i64 %61, %43 + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_mask_return.exit1611, label %panic.i1610 -mask_block_ok.i.i.i745: ; preds = %cond_exit_687.thread.7.i.i, %128 - %.02.i.i.i746 = phi i64 [ %129, %128 ], [ 0, %cond_exit_687.thread.7.i.i ] - %gep.i.i.i747 = getelementptr i64, ptr %107, i64 %.02.i.i.i746 - %130 = load i64, ptr %gep.i.i.i747, align 4 - %131 = icmp eq i64 %130, -1 - br i1 %131, label %128, label %mask_block_err.i.i.i748 +panic.i1610: ; preds = %__barray_check_bounds.exit1609 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i748: ; preds = %mask_block_ok.i.i.i745 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1611: ; preds = %__barray_check_bounds.exit1609 + %64 = xor i64 %61, %46 + store i64 %64, ptr %5, align 4 + store i64 %49, ptr %48, align 4 + %65 = add nuw nsw i64 %37, 1 + %exitcond1673.not = icmp eq i64 %65, %indvars.iv + br i1 %exitcond1673.not, label %loop_out.loopexit, label %__barray_check_bounds.exit1597 + +out_of_bounds.i1612: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %132 = shl nuw i64 1, %109 - %133 = xor i64 %108, %132 - store i64 %133, ptr %107, align 4 - %134 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %"684_1.sroa.10.0.i.i" - %135 = load i64, ptr %134, align 4 - tail call void @___dec_future_refcount(i64 %135) - br label %cond_exit_687.thread.i.i - -cond_exit_687.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %136 = add i64 %"684_1.sroa.10.0.i.i", 1 - %137 = lshr i64 %136, 6 - %138 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %137 - %139 = load i64, ptr %138, align 4 - %140 = and i64 %136, 63 - %141 = lshr i64 %139, %140 - %142 = trunc i64 %141 to i1 - br i1 %142, label %cond_exit_687.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_687.thread.i.i - %143 = shl nuw i64 1, %140 - %144 = xor i64 %139, %143 - store i64 %144, ptr %138, align 4 - %145 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %136 - %146 = load i64, ptr %145, align 4 - tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_687.thread.1.i.i - -cond_exit_687.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_687.thread.i.i - %147 = add i64 %"684_1.sroa.10.0.i.i", 2 - %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %148 - %150 = load i64, ptr %149, align 4 - %151 = and i64 %147, 63 - %152 = lshr i64 %150, %151 - %153 = trunc i64 %152 to i1 - br i1 %153, label %cond_exit_687.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_687.thread.1.i.i - %154 = shl nuw i64 1, %151 - %155 = xor i64 %150, %154 - store i64 %155, ptr %149, align 4 - %156 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %147 - %157 = load i64, ptr %156, align 4 - tail call void @___dec_future_refcount(i64 %157) - br label %cond_exit_687.thread.2.i.i - -cond_exit_687.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_687.thread.1.i.i - %158 = add i64 %"684_1.sroa.10.0.i.i", 3 - %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %159 - %161 = load i64, ptr %160, align 4 - %162 = and i64 %158, 63 - %163 = lshr i64 %161, %162 - %164 = trunc i64 %163 to i1 - br i1 %164, label %cond_exit_687.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_687.thread.2.i.i - %165 = shl nuw i64 1, %162 - %166 = xor i64 %161, %165 - store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %158 - %168 = load i64, ptr %167, align 4 - tail call void @___dec_future_refcount(i64 %168) - br label %cond_exit_687.thread.3.i.i - -cond_exit_687.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_687.thread.2.i.i - %169 = add i64 %"684_1.sroa.10.0.i.i", 4 - %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %170 - %172 = load i64, ptr %171, align 4 - %173 = and i64 %169, 63 - %174 = lshr i64 %172, %173 - %175 = trunc i64 %174 to i1 - br i1 %175, label %cond_exit_687.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_687.thread.3.i.i - %176 = shl nuw i64 1, %173 - %177 = xor i64 %172, %176 - store i64 %177, ptr %171, align 4 - %178 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %169 - %179 = load i64, ptr %178, align 4 - tail call void @___dec_future_refcount(i64 %179) - br label %cond_exit_687.thread.4.i.i - -cond_exit_687.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_687.thread.3.i.i - %180 = add i64 %"684_1.sroa.10.0.i.i", 5 - %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %181 - %183 = load i64, ptr %182, align 4 - %184 = and i64 %180, 63 - %185 = lshr i64 %183, %184 - %186 = trunc i64 %185 to i1 - br i1 %186, label %cond_exit_687.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_687.thread.4.i.i - %187 = shl nuw i64 1, %184 - %188 = xor i64 %183, %187 - store i64 %188, ptr %182, align 4 - %189 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %180 - %190 = load i64, ptr %189, align 4 - tail call void @___dec_future_refcount(i64 %190) - br label %cond_exit_687.thread.5.i.i - -cond_exit_687.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_687.thread.4.i.i - %191 = add i64 %"684_1.sroa.10.0.i.i", 6 - %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %192 - %194 = load i64, ptr %193, align 4 - %195 = and i64 %191, 63 - %196 = lshr i64 %194, %195 - %197 = trunc i64 %196 to i1 - br i1 %197, label %cond_exit_687.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_687.thread.5.i.i - %198 = shl nuw i64 1, %195 - %199 = xor i64 %194, %198 - store i64 %199, ptr %193, align 4 - %200 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %191 - %201 = load i64, ptr %200, align 4 - tail call void @___dec_future_refcount(i64 %201) - br label %cond_exit_687.thread.6.i.i - -cond_exit_687.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_687.thread.5.i.i - %202 = add i64 %"684_1.sroa.10.0.i.i", 7 - %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"684_1.sroa.5.0.i.i", i64 %203 - %205 = load i64, ptr %204, align 4 - %206 = and i64 %202, 63 - %207 = lshr i64 %205, %206 - %208 = trunc i64 %207 to i1 - br i1 %208, label %cond_exit_687.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_687.thread.6.i.i - %209 = shl nuw i64 1, %206 - %210 = xor i64 %205, %209 - store i64 %210, ptr %204, align 4 - %211 = getelementptr inbounds i64, ptr %"684_1.sroa.0.0.i.i", i64 %202 - %212 = load i64, ptr %211, align 4 - tail call void @___dec_future_refcount(i64 %212) - br label %cond_exit_687.thread.7.i.i - -cond_exit_687.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_687.thread.6.i.i - %213 = load i64, ptr %107, align 4 - %214 = sub nuw nsw i64 64, %109 - %215 = lshr i64 -1, %214 - %216 = icmp eq i64 %109, 0 - %217 = select i1 %216, i64 0, i64 %215 - %218 = or i64 %213, %217 - store i64 %218, ptr %107, align 4 - %219 = load i64, ptr %204, align 4 - %220 = shl nsw i64 -2, %206 - %221 = icmp eq i64 %206, 63 - %222 = select i1 %221, i64 0, i64 %220 - %223 = or i64 %219, %222 - store i64 %223, ptr %204, align 4 - %reass.sub.i.i.i743 = sub nsw i64 %203, %106 - %.not.i.i.i744 = icmp eq i64 %reass.sub.i.i.i743, -1 - br i1 %.not.i.i.i744, label %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit", label %mask_block_ok.i.i.i745 - -__barray_check_bounds.exit.i739: ; preds = %__barray_check_bounds.exit221.i.i - %224 = xor i64 %125, %121 - store i64 %224, ptr %116, align 4 - store i64 %124, ptr %123, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %124) - tail call void @___dec_future_refcount(i64 %124) - %225 = load i64, ptr %105, align 4 - %226 = lshr i64 %225, %"308_0.sroa.15.0168.i" - %227 = trunc i64 %226 to i1 - br i1 %227, label %loop_body.i741, label %panic.i.i740 - -panic.i.i740: ; preds = %__barray_check_bounds.exit.i739 +__barray_check_bounds.exit1613: ; preds = %.thread + %66 = load i64, ptr %3, align 4 + %67 = lshr i64 %66, %"406_2.01682" + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_410, label %panic.i1614 + +panic.i1614: ; preds = %__barray_check_bounds.exit1613 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i741: ; preds = %__barray_check_bounds.exit.i739 - %228 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %113, 1 - %229 = shl nuw nsw i64 1, %"308_0.sroa.15.0168.i" - %230 = xor i64 %225, %229 - store i64 %230, ptr %105, align 4 - %231 = getelementptr inbounds nuw i1, ptr %104, i64 %"308_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %231, align 1 - %232 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i742 = icmp eq i64 %113, 8 - br i1 %exitcond.not.i742, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i738 - -"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit": ; preds = %128, %cond_exit_687.thread.7.i.i - tail call void @heap_free(ptr %"684_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"684_1.sroa.5.0.i.i") - %233 = load i64, ptr %105, align 4 - %234 = and i64 %233, 255 - store i64 %234, ptr %105, align 4 - %235 = icmp eq i64 %234, 0 - br i1 %235, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_410 + %69 = load i64, ptr %5, align 4 + %70 = or i64 %69, -256 + store i64 %70, ptr %5, align 4 + %71 = icmp eq i64 %70, -1 + br i1 %71, label %loop_body739.preheader.preheader, label %mask_block_err.i -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$8.294.exit" - %236 = tail call ptr @heap_alloc(i64 8) - %237 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %237, align 1 - %238 = load i64, ptr %104, align 1 - store i64 %238, ptr %236, align 1 - tail call void @heap_free(ptr nonnull %236) - %239 = load i64, ptr %105, align 4 - %240 = and i64 %239, 255 - store i64 %240, ptr %105, align 4 - %241 = icmp eq i64 %240, 0 - br i1 %241, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i754 - -mask_block_err.i754: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit755: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %242 = alloca [8 x i1], align 8 - store i64 0, ptr %242, align 8 - store i32 8, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %104, ptr %arr_ptr, align 8 - store ptr %242, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) - ret void - -__barray_check_bounds.exit757: ; preds = %__barray_mask_return.exit733, %__barray_mask_return.exit771 - %"136_3.0801" = phi i64 [ %243, %__barray_mask_return.exit771 ], [ 0, %__barray_mask_return.exit733 ] - %243 = add nuw nsw i64 %"136_3.0801", 1 - %244 = sub nuw nsw i64 7, %"136_3.0801" - %245 = load i64, ptr %1, align 4 - %246 = lshr i64 %245, %"45_0.0802" - %247 = trunc i64 %246 to i1 - br i1 %247, label %panic.i758, label %cond_188_case_1 +__barray_check_bounds.exit1617: ; preds = %__barray_mask_return.exit1595, %cond_exit_410 + %"406_0.sroa.15.01683" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %72, %cond_exit_410 ] + %"406_2.01682" = phi i64 [ 0, %__barray_mask_return.exit1595 ], [ %80, %cond_exit_410 ] + %72 = add nuw nsw i64 %"406_0.sroa.15.01683", 1 + %73 = load i64, ptr %5, align 4 + %74 = lshr i64 %73, %"406_0.sroa.15.01683" + %75 = trunc i64 %74 to i1 + br i1 %75, label %panic.i1618, label %.thread -panic.i758: ; preds = %__barray_check_bounds.exit757 +panic.i1618: ; preds = %__barray_check_bounds.exit1617 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -248: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) +.thread: ; preds = %__barray_check_bounds.exit1617 + %76 = shl nuw nsw i64 1, %"406_0.sroa.15.01683" + %77 = xor i64 %73, %76 + store i64 %77, ptr %5, align 4 + %78 = getelementptr inbounds nuw i64, ptr %4, i64 %"406_0.sroa.15.01683" + %79 = load i64, ptr %78, align 4 + %80 = add i64 %"406_2.01682", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %79) + tail call void @___qfree(i64 %79) + %81 = icmp ult i64 %"406_2.01682", 8 + br i1 %81, label %__barray_check_bounds.exit1613, label %out_of_bounds.i1612 + +cond_exit_410: ; preds = %__barray_check_bounds.exit1613 + %82 = shl nuw nsw i64 1, %"406_2.01682" + %83 = xor i64 %66, %82 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i64, ptr %2, i64 %"406_2.01682" + store i64 %lazy_measure, ptr %84, align 4 + %85 = icmp samesign ugt i64 %"406_0.sroa.15.01683", 6 + br i1 %85, label %mask_block_ok.i, label %__barray_check_bounds.exit1617 + +loop_body739.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1621: ; preds = %cond_exit_476, %loop_body739.preheader.preheader + %"472_0.sroa.15.01670" = phi i64 [ %86, %cond_exit_476 ], [ 0, %loop_body739.preheader.preheader ] + %86 = add nuw nsw i64 %"472_0.sroa.15.01670", 1 + %87 = load i64, ptr %3, align 4 + %88 = lshr i64 %87, %"472_0.sroa.15.01670" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1622, label %__barray_check_bounds.exit1625 + +panic.i1622: ; preds = %__barray_check_bounds.exit1621 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit761: ; preds = %__hugr__.guppylang.std.num.int.__pow__.413.exit - %249 = lshr i64 %2, %244 - %250 = trunc i64 %249 to i1 - br i1 %250, label %panic.i762, label %__barray_check_bounds.exit765 - -panic.i762: ; preds = %__barray_check_bounds.exit761 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1625: ; preds = %__barray_check_bounds.exit1621 + %90 = shl nuw nsw i64 1, %"472_0.sroa.15.01670" + %91 = xor i64 %87, %90 + store i64 %91, ptr %3, align 4 + %92 = getelementptr inbounds nuw i64, ptr %2, i64 %"472_0.sroa.15.01670" + %93 = load i64, ptr %92, align 4 + tail call void @___inc_future_refcount(i64 %93) + %94 = load i64, ptr %3, align 4 + %95 = lshr i64 %94, %"472_0.sroa.15.01670" + %96 = trunc i64 %95 to i1 + br i1 %96, label %__barray_check_bounds.exit1629, label %panic.i1626 + +panic.i1626: ; preds = %__barray_check_bounds.exit1625 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit765: ; preds = %__barray_check_bounds.exit761 - %251 = shl nuw nsw i64 1, %244 - %252 = xor i64 %2, %251 - store i64 %252, ptr %1, align 4 - %253 = getelementptr inbounds nuw i64, ptr %0, i64 %244 - %254 = load i64, ptr %253, align 4 - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - %255 = fmul double %5, 0x400921FB54442D18 - %256 = fmul double %255, 5.000000e-01 - %257 = fneg double %256 - tail call void @___rpp(i64 %3, i64 %254, double %257, double 0xC00921FB54442D18) - tail call void @___rp(i64 %254, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %254, double %256) - tail call void @___rp(i64 %3, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - %258 = load i64, ptr %1, align 4 - %259 = lshr i64 %258, %"45_0.0802" - %260 = trunc i64 %259 to i1 - br i1 %260, label %__barray_check_bounds.exit769, label %panic.i766 - -panic.i766: ; preds = %__barray_check_bounds.exit765 +__barray_check_bounds.exit1629: ; preds = %__barray_check_bounds.exit1625 + %97 = xor i64 %94, %90 + store i64 %97, ptr %3, align 4 + store i64 %93, ptr %92, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %93) + tail call void @___dec_future_refcount(i64 %93) + %98 = load i64, ptr %1, align 4 + %99 = lshr i64 %98, %"472_0.sroa.15.01670" + %100 = trunc i64 %99 to i1 + br i1 %100, label %cond_exit_476, label %panic.i1630 + +panic.i1630: ; preds = %__barray_check_bounds.exit1629 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit769: ; preds = %__barray_check_bounds.exit765 - %261 = xor i64 %258, %43 - store i64 %261, ptr %1, align 4 - store i64 %3, ptr %45, align 4 - %262 = load i64, ptr %1, align 4 - %263 = lshr i64 %262, %244 - %264 = trunc i64 %263 to i1 - br i1 %264, label %__barray_mask_return.exit771, label %panic.i770 +mask_block_err.i1635: ; preds = %cond_exit_677.7 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -panic.i770: ; preds = %__barray_check_bounds.exit769 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_mask_borrow.exit1643: ; preds = %__barray_check_bounds.exit1639.preheader + %101 = or disjoint i64 %144, 1 + store i64 %101, ptr %3, align 4 + %102 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %102) + br label %cond_exit_677 + +cond_exit_677: ; preds = %__barray_mask_borrow.exit1643, %__barray_check_bounds.exit1639.preheader + %103 = load i64, ptr %3, align 4 + %104 = and i64 %103, 2 + %.not = icmp eq i64 %104, 0 + br i1 %.not, label %__barray_mask_borrow.exit1643.1, label %cond_exit_677.1 + +__barray_mask_borrow.exit1643.1: ; preds = %cond_exit_677 + %105 = or disjoint i64 %103, 2 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %107 = load i64, ptr %106, align 4 + tail call void @___dec_future_refcount(i64 %107) + br label %cond_exit_677.1 + +cond_exit_677.1: ; preds = %__barray_mask_borrow.exit1643.1, %cond_exit_677 + %108 = load i64, ptr %3, align 4 + %109 = and i64 %108, 4 + %.not1687 = icmp eq i64 %109, 0 + br i1 %.not1687, label %__barray_mask_borrow.exit1643.2, label %cond_exit_677.2 + +__barray_mask_borrow.exit1643.2: ; preds = %cond_exit_677.1 + %110 = or disjoint i64 %108, 4 + store i64 %110, ptr %3, align 4 + %111 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %112 = load i64, ptr %111, align 4 + tail call void @___dec_future_refcount(i64 %112) + br label %cond_exit_677.2 + +cond_exit_677.2: ; preds = %__barray_mask_borrow.exit1643.2, %cond_exit_677.1 + %113 = load i64, ptr %3, align 4 + %114 = and i64 %113, 8 + %.not1688 = icmp eq i64 %114, 0 + br i1 %.not1688, label %__barray_mask_borrow.exit1643.3, label %cond_exit_677.3 + +__barray_mask_borrow.exit1643.3: ; preds = %cond_exit_677.2 + %115 = or disjoint i64 %113, 8 + store i64 %115, ptr %3, align 4 + %116 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %117 = load i64, ptr %116, align 4 + tail call void @___dec_future_refcount(i64 %117) + br label %cond_exit_677.3 + +cond_exit_677.3: ; preds = %__barray_mask_borrow.exit1643.3, %cond_exit_677.2 + %118 = load i64, ptr %3, align 4 + %119 = and i64 %118, 16 + %.not1689 = icmp eq i64 %119, 0 + br i1 %.not1689, label %__barray_mask_borrow.exit1643.4, label %cond_exit_677.4 + +__barray_mask_borrow.exit1643.4: ; preds = %cond_exit_677.3 + %120 = or disjoint i64 %118, 16 + store i64 %120, ptr %3, align 4 + %121 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %122 = load i64, ptr %121, align 4 + tail call void @___dec_future_refcount(i64 %122) + br label %cond_exit_677.4 + +cond_exit_677.4: ; preds = %__barray_mask_borrow.exit1643.4, %cond_exit_677.3 + %123 = load i64, ptr %3, align 4 + %124 = and i64 %123, 32 + %.not1690 = icmp eq i64 %124, 0 + br i1 %.not1690, label %__barray_mask_borrow.exit1643.5, label %cond_exit_677.5 + +__barray_mask_borrow.exit1643.5: ; preds = %cond_exit_677.4 + %125 = or disjoint i64 %123, 32 + store i64 %125, ptr %3, align 4 + %126 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %127 = load i64, ptr %126, align 4 + tail call void @___dec_future_refcount(i64 %127) + br label %cond_exit_677.5 + +cond_exit_677.5: ; preds = %__barray_mask_borrow.exit1643.5, %cond_exit_677.4 + %128 = load i64, ptr %3, align 4 + %129 = and i64 %128, 64 + %.not1691 = icmp eq i64 %129, 0 + br i1 %.not1691, label %__barray_mask_borrow.exit1643.6, label %cond_exit_677.6 + +__barray_mask_borrow.exit1643.6: ; preds = %cond_exit_677.5 + %130 = or disjoint i64 %128, 64 + store i64 %130, ptr %3, align 4 + %131 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %132 = load i64, ptr %131, align 4 + tail call void @___dec_future_refcount(i64 %132) + br label %cond_exit_677.6 + +cond_exit_677.6: ; preds = %__barray_mask_borrow.exit1643.6, %cond_exit_677.5 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 128 + %.not1692 = icmp eq i64 %134, 0 + br i1 %.not1692, label %__barray_mask_borrow.exit1643.7, label %cond_exit_677.7 + +__barray_mask_borrow.exit1643.7: ; preds = %cond_exit_677.6 + %135 = or disjoint i64 %133, 128 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %137 = load i64, ptr %136, align 4 + tail call void @___dec_future_refcount(i64 %137) + br label %cond_exit_677.7 + +cond_exit_677.7: ; preds = %__barray_mask_borrow.exit1643.7, %cond_exit_677.6 + %138 = load i64, ptr %3, align 4 + %139 = or i64 %138, -256 + store i64 %139, ptr %3, align 4 + %140 = icmp eq i64 %139, -1 + br i1 %140, label %loop_out738, label %mask_block_err.i1635 + +cond_exit_476: ; preds = %__barray_check_bounds.exit1629 + %141 = xor i64 %98, %90 + store i64 %141, ptr %1, align 4 + %142 = getelementptr inbounds nuw i1, ptr %0, i64 %"472_0.sroa.15.01670" + store i1 %read_bool, ptr %142, align 1 + %143 = icmp eq i64 %"472_0.sroa.15.01670", 7 + br i1 %143, label %__barray_check_bounds.exit1639.preheader, label %__barray_check_bounds.exit1621 + +__barray_check_bounds.exit1639.preheader: ; preds = %cond_exit_476 + %144 = load i64, ptr %3, align 4 + %145 = trunc i64 %144 to i1 + br i1 %145, label %cond_exit_677, label %__barray_mask_borrow.exit1643 + +loop_out738: ; preds = %cond_exit_677.7 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %146 = load i64, ptr %1, align 4 + %147 = and i64 %146, 255 + store i64 %147, ptr %1, align 4 + %148 = icmp eq i64 %147, 0 + br i1 %148, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1644 + +mask_block_err.i1644: ; preds = %loop_out738 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_return.exit771: ; preds = %__barray_check_bounds.exit769 - %265 = xor i64 %262, %251 - store i64 %265, ptr %1, align 4 - store i64 %254, ptr %253, align 4 - %exitcond.not = icmp eq i64 %243, %smax - br i1 %exitcond.not, label %cond_exit_173.loopexit, label %__barray_check_bounds.exit757 +__barray_check_none_borrowed.exit: ; preds = %loop_out738 + %149 = tail call ptr @heap_alloc(i64 8) + %150 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %150, align 1 + %151 = load i64, ptr %0, align 1 + store i64 %151, ptr %149, align 1 + tail call void @heap_free(ptr nonnull %149) + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 255 + store i64 %153, ptr %1, align 4 + %154 = icmp eq i64 %153, 0 + br i1 %154, label %__barray_check_none_borrowed.exit1648, label %mask_block_err.i1646 + +mask_block_err.i1646: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1648: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %155 = alloca [8 x i1], align 8 + store i64 0, ptr %155, align 8 + store i32 8, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %155, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_measuremen.F30240EB.0, i64 25, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -740,18 +538,18 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare i1 @___read_future_bool(i64) local_unnamed_addr - -declare void @___dec_future_refcount(i64) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr @@ -777,9 +575,6 @@ declare i64 @teardown() local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.smax.i64(i64, i64) #1 - attributes #0 = { noreturn } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/selene-sim/Cargo.toml b/selene-sim/Cargo.toml index 436371bd..603283fe 100644 --- a/selene-sim/Cargo.toml +++ b/selene-sim/Cargo.toml @@ -18,6 +18,15 @@ serde = { version = "1.0", features = ["derive"] } serde_yml = "0.0.12" rand_pcg = "0.9" url = "2.5" +backtrace = "0.3" + +[target.'cfg(unix)'.dependencies] +libc = "0.2" + +[target.'cfg(windows)'.dependencies] +windows-sys = { version = "0.61", features = [ + "Win32_System_LibraryLoader", +] } [lints] workspace = true diff --git a/selene-sim/python/selene_sim/exceptions.py b/selene-sim/python/selene_sim/exceptions.py index e79c8af6..bdeb8109 100644 --- a/selene-sim/python/selene_sim/exceptions.py +++ b/selene-sim/python/selene_sim/exceptions.py @@ -1,3 +1,35 @@ +from selene_sim.stack_trace import StackTrace + + +def maybe_provide_stack_trace(stack_trace: StackTrace | None) -> str: + if stack_trace is None or not stack_trace.entries: + return "" + + rendered_stack_trace = str(stack_trace) + failure = stack_trace.symbolization_failure + + if not rendered_stack_trace: + if failure is not None: + return ( + "\nAn attempt was made to establish the stack trace, but it failed " + f"while {failure}." + ) + if not stack_trace.symbolization_attempted: + return ( + "\nStack trace addresses were captured, but symbolization was not " + "attempted." + ) + return "" + + result = f"\nStack trace:\n{rendered_stack_trace}" + if failure is None: + return result + return ( + f"{result}\nSome stack trace information may be unavailable because " + f"the attempt failed while {failure}." + ) + + def maybe_provide_log(name, contents): if len(contents) == 0: return "" @@ -13,17 +45,28 @@ class SeleneBuildError(Exception): Raised when selene fails to build the user program. """ - def __init__(self, message: str, stdout: str = "", stderr: str = ""): + def __init__( + self, + message: str, + stdout: str = "", + stderr: str = "", + stack_trace: StackTrace | None = None, + ): self.message = message self.stdout = stdout self.stderr = stderr + self.stack_trace = stack_trace def __reduce__(self): - return (self.__class__, (self.message, self.stdout, self.stderr)) + return ( + self.__class__, + (self.message, self.stdout, self.stderr, self.stack_trace), + ) def __str__(self): return ( self.message + + maybe_provide_stack_trace(self.stack_trace) + maybe_provide_log("stdout", self.stdout) + maybe_provide_log("stderr", self.stderr) ) @@ -36,17 +79,28 @@ class SeleneStartupError(Exception): sign of invalid arguments being passed in. """ - def __init__(self, message: str, stdout: str = "", stderr: str = ""): + def __init__( + self, + message: str, + stdout: str = "", + stderr: str = "", + stack_trace: StackTrace | None = None, + ): self.message = message self.stdout = stdout self.stderr = stderr + self.stack_trace = stack_trace def __reduce__(self): - return (self.__class__, (self.message, self.stdout, self.stderr)) + return ( + self.__class__, + (self.message, self.stdout, self.stderr, self.stack_trace), + ) def __str__(self): return ( self.message + + maybe_provide_stack_trace(self.stack_trace) + maybe_provide_log("stdout", self.stdout) + maybe_provide_log("stderr", self.stderr) ) @@ -58,17 +112,28 @@ class SeleneRuntimeError(Exception): without a panic being issued through the results channel. """ - def __init__(self, message: str, stdout: str = "", stderr: str = ""): + def __init__( + self, + message: str, + stdout: str = "", + stderr: str = "", + stack_trace: StackTrace | None = None, + ): self.message = message self.stdout = stdout self.stderr = stderr + self.stack_trace = stack_trace def __reduce__(self): - return (self.__class__, (self.message, self.stdout, self.stderr)) + return ( + self.__class__, + (self.message, self.stdout, self.stderr, self.stack_trace), + ) def __str__(self): return ( self.message + + maybe_provide_stack_trace(self.stack_trace) + maybe_provide_log("stdout", self.stdout) + maybe_provide_log("stderr", self.stderr) ) @@ -80,18 +145,30 @@ class SelenePanicError(Exception): > 1000, i.e. all remaining shots are halted. """ - def __init__(self, message: str, code: int, stdout: str = "", stderr: str = ""): + def __init__( + self, + message: str, + code: int, + stdout: str = "", + stderr: str = "", + stack_trace: StackTrace | None = None, + ): self.message = message self.code = code self.stdout = stdout self.stderr = stderr + self.stack_trace = stack_trace def __reduce__(self): - return (self.__class__, (self.message, self.code, self.stdout, self.stderr)) + return ( + self.__class__, + (self.message, self.code, self.stdout, self.stderr, self.stack_trace), + ) def __str__(self): return ( f"Panic (#{self.code}): {self.message}" + + maybe_provide_stack_trace(self.stack_trace) + maybe_provide_log("stdout", self.stdout) + maybe_provide_log("stderr", self.stderr) ) @@ -102,17 +179,28 @@ class SeleneTimeoutError(Exception): Raised when the user program times out. """ - def __init__(self, message: str, stdout: str = "", stderr: str = ""): + def __init__( + self, + message: str, + stdout: str = "", + stderr: str = "", + stack_trace: StackTrace | None = None, + ): self.message = message self.stdout = stdout self.stderr = stderr + self.stack_trace = stack_trace def __reduce__(self): - return (self.__class__, (self.message, self.stdout, self.stderr)) + return ( + self.__class__, + (self.message, self.stdout, self.stderr, self.stack_trace), + ) def __str__(self): return ( f"Timeout: {self.message}" + + maybe_provide_stack_trace(self.stack_trace) + maybe_provide_log("stdout", self.stdout) + maybe_provide_log("stderr", self.stderr) ) diff --git a/selene-sim/python/selene_sim/result_handling/exception_encoding.py b/selene-sim/python/selene_sim/result_handling/exception_encoding.py index 54dd3f46..d7968914 100644 --- a/selene-sim/python/selene_sim/result_handling/exception_encoding.py +++ b/selene-sim/python/selene_sim/result_handling/exception_encoding.py @@ -6,6 +6,7 @@ SeleneStartupError, SeleneTimeoutError, ) +from selene_sim.stack_trace import StackTrace, Symbol from . import TaggedResult @@ -15,10 +16,81 @@ EXCEPTION_TYPE_PREFIX = "_EXCEPTION:INT:" STDERR_PREFIX = "_STDERR:INT:" STDOUT_PREFIX = "_STDOUT:INT:" +TRACE_PREFIX = "_TRACE:INT:" +TRACE_SYMBOL_ENTRY_TAG = "_TRACE_SYMBOL_ENTRY:INT" +TRACE_SYMBOL_LINE_TAG = "_TRACE_SYMBOL_LINE:INT" +TRACE_SYMBOL_COLUMN_TAG = "_TRACE_SYMBOL_COLUMN:INT" +TRACE_SYMBOL_FILENAME_PREFIX = "_TRACE_SYMBOL_FILENAME:INT:" +TRACE_SYMBOL_FUNCTION_PREFIX = "_TRACE_SYMBOL_FUNCTION:INT:" +TRACE_ATTEMPTED_TAG = "_TRACE_SYMBOLIZATION_ATTEMPTED:BOOL" +TRACE_FAILURE_PREFIX = "_TRACE_SYMBOLIZATION_FAILURE:INT:" + + +def _read_metadata_value(results: Iterator[TaggedResult], expected_tag: str) -> int: + tag, value = next(results) + if tag != expected_tag or not isinstance(value, int): + raise ValueError(f"Expected {expected_tag} stack trace metadata") + return value + + +def _read_metadata_string(results: Iterator[TaggedResult], expected_prefix: str) -> str: + tag, value = next(results) + if not tag.startswith(expected_prefix) or not isinstance(value, int): + raise ValueError(f"Expected {expected_prefix} stack trace metadata") + return tag.removeprefix(expected_prefix) + + +def _decode_symbol( + entry_index: int, + results: Iterator[TaggedResult], + stack_trace: StackTrace, +) -> None: + if not 0 <= entry_index < len(stack_trace.entries): + raise ValueError(f"Invalid stack trace entry index {entry_index}") + line = _read_metadata_value(results, TRACE_SYMBOL_LINE_TAG) + column = _read_metadata_value(results, TRACE_SYMBOL_COLUMN_TAG) + filename = _read_metadata_string(results, TRACE_SYMBOL_FILENAME_PREFIX) + function_name = _read_metadata_string(results, TRACE_SYMBOL_FUNCTION_PREFIX) + stack_trace.entries[entry_index].symbols.append( + Symbol( + column=column, + line=line, + filename=filename, + function_name=function_name, + ) + ) + + +def encode_stacktrace(stacktrace: StackTrace | None) -> Iterator[TaggedResult]: + if stacktrace is None: + return + for trace_entry in stacktrace.entries: + yield ( + f"{TRACE_PREFIX}{trace_entry.module}", + trace_entry.address, + ) + # Keep raw trace entries first so older consumers still recover every + # module/address pair before encountering metadata they do not understand. + for entry_index, trace_entry in enumerate(stacktrace.entries): + for symbol in trace_entry.symbols: + yield (TRACE_SYMBOL_ENTRY_TAG, entry_index) + yield (TRACE_SYMBOL_LINE_TAG, symbol.line) + yield (TRACE_SYMBOL_COLUMN_TAG, symbol.column) + yield (f"{TRACE_SYMBOL_FILENAME_PREFIX}{symbol.filename}", 0) + yield (f"{TRACE_SYMBOL_FUNCTION_PREFIX}{symbol.function_name}", 0) + yield (TRACE_ATTEMPTED_TAG, stacktrace.symbolization_attempted) + if stacktrace.symbolization_failure is not None: + yield ( + f"{TRACE_FAILURE_PREFIX}{stacktrace.symbolization_failure}", + 0, + ) def encode_exception( - exception: Exception, stdout_file: Path, stderr_file: Path + exception: Exception, + stdout_file: Path, + stderr_file: Path, + stack_trace: StackTrace | None = None, ) -> Iterator[TaggedResult]: """ Given an exception that occurs during a shot, encode it as a series @@ -34,6 +106,7 @@ def encode_exception( yield (message, code) yield (f"{STDERR_PREFIX}{stderr_file}", 0) yield (f"{STDOUT_PREFIX}{stdout_file}", 0) + yield from encode_stacktrace(stack_trace) case SeleneRuntimeError(message=message): # We need to encode the EXIT:INT: prefix here, # and provide a generic code. @@ -41,6 +114,7 @@ def encode_exception( yield (f"EXIT:INT:{message}", 110000) yield (f"{STDERR_PREFIX}{stderr_file}", 0) yield (f"{STDOUT_PREFIX}{stdout_file}", 0) + yield from encode_stacktrace(stack_trace) case SeleneStartupError(message=message): # We need to encode the EXIT:INT: prefix here, # and provide a generic code. @@ -48,6 +122,7 @@ def encode_exception( yield (f"EXIT:INT:{message}", 110001) yield (f"{STDERR_PREFIX}{stderr_file}", 0) yield (f"{STDOUT_PREFIX}{stdout_file}", 0) + yield from encode_stacktrace(stack_trace) case SeleneTimeoutError(message=message): # We need to encode the EXIT:INT: prefix here, # and provide a generic code. @@ -55,6 +130,7 @@ def encode_exception( yield (f"EXIT:INT:{message}", 110002) yield (f"{STDERR_PREFIX}{stderr_file}", 0) yield (f"{STDOUT_PREFIX}{stdout_file}", 0) + yield from encode_stacktrace(stack_trace) case other: # Encapsulate any other exception into a # SeleneRuntimeError for consistent parsing @@ -63,6 +139,7 @@ def encode_exception( yield (f"EXIT:INT:{other}", 110000) yield (f"{STDERR_PREFIX}{stderr_file}", 0) yield (f"{STDOUT_PREFIX}{stdout_file}", 0) + yield from encode_stacktrace(stack_trace) def detect_exception( @@ -104,6 +181,45 @@ def decode_exception( message=f"Error while decoding exception: Missing stdout for exception type {exception_type} and message {error_message}: {e}.", ) + stack_trace = StackTrace() + while True: + try: + trace_entry = next(remaining_results) + tag = trace_entry[0] + value = trace_entry[1] + if tag.startswith(TRACE_PREFIX): + if not isinstance(value, int): + raise TypeError("Stack trace address must be an integer") + module = Path(tag.removeprefix(TRACE_PREFIX)) + stack_trace.add_entry( + module=module, + address=value, + ) + elif tag == TRACE_SYMBOL_ENTRY_TAG: + if not isinstance(value, int): + raise TypeError("Stack trace entry index must be an integer") + _decode_symbol(value, remaining_results, stack_trace) + elif tag == TRACE_ATTEMPTED_TAG: + if not isinstance(value, bool): + raise TypeError("Stack trace attempted status must be a boolean") + stack_trace.symbolization_attempted = value + elif tag.startswith(TRACE_FAILURE_PREFIX): + if not isinstance(value, int): + raise TypeError("Stack trace failure value must be an integer") + stack_trace.symbolization_failure = tag.removeprefix( + TRACE_FAILURE_PREFIX + ) + else: + break + except StopIteration: + break + except Exception as e: + return SeleneRuntimeError( + message=f"Error while decoding exception: Malformed stack trace entry for exception type {exception_type} and message {error_message}: {e}.", + stdout=stdout_content, + stderr=stderr_content, + ) + match exception_type: case "SelenePanicError": return SelenePanicError( @@ -111,30 +227,35 @@ def decode_exception( code=error_code, stdout=stdout_content, stderr=stderr_content, + stack_trace=stack_trace, ) case "SeleneRuntimeError": return SeleneRuntimeError( message=error_message, stdout=stdout_content, stderr=stderr_content, + stack_trace=stack_trace, ) case "SeleneStartupError": return SeleneStartupError( message=error_message, stdout=stdout_content, stderr=stderr_content, + stack_trace=stack_trace, ) case "SeleneTimeoutError": return SeleneTimeoutError( message=error_message, stdout=stdout_content, stderr=stderr_content, + stack_trace=stack_trace, ) case _: return SeleneRuntimeError( message=f"Unknown exception type: {exception_type}", stdout=stdout_content, stderr=stderr_content, + stack_trace=stack_trace, ) diff --git a/selene-sim/python/selene_sim/result_handling/extract_shot.py b/selene-sim/python/selene_sim/result_handling/extract_shot.py index d4967ab3..ad3482fe 100644 --- a/selene-sim/python/selene_sim/result_handling/extract_shot.py +++ b/selene-sim/python/selene_sim/result_handling/extract_shot.py @@ -1,9 +1,9 @@ from dataclasses import dataclass +from pathlib import Path from typing import Iterator from enum import Enum from ..exceptions import ( - SelenePanicError, SeleneStartupError, SeleneRuntimeError, ) @@ -38,6 +38,18 @@ class FullPanicMessage: code: int +@dataclass +class DebugTraceMessage: + """ + Upon a panic, this may be emitted to provide the address of each element in the + stack frame. This address may be utilised to extract symbol information for + stacktrace printing. + """ + + module: Path + address: int + + @dataclass class ShotStart: """ @@ -133,11 +145,13 @@ class ShotMeasurements: UserResult | UserStateResult | ShotExitMessage + | FullPanicMessage | MetricValue | InstructionLogEntry | ShotMeasurements + | DebugTraceMessage ) -ExtractedStreamEntry = ShotStart | ShotEnd | ShotEntry | FullPanicMessage +ExtractedStreamEntry = ShotStart | ShotEnd | ShotEntry def extract_single_entry(entry: StreamEntry) -> ExtractedStreamEntry: @@ -165,6 +179,12 @@ def extract_single_entry(entry: StreamEntry) -> ExtractedStreamEntry: return FullPanicMessage(message=entry.tag, code=code) else: return ShotExitMessage(message=entry.tag, code=code) + elif entry.tag.startswith("DEBUG:BACKTRACE:"): + module = entry.tag.split(":", maxsplit=2)[-1] + assert isinstance(entry.values[0], int), ( + f"Expected backtrace address to be an integer, got {type(entry.values[0])}" + ) + return DebugTraceMessage(module=Path(module), address=entry.values[0]) elif entry.tag.startswith("USER:"): if entry.tag.startswith("USER:STATE:"): assert len(entry.values) == 1, ( @@ -244,12 +264,12 @@ def extract_shot( raise SeleneRuntimeError( f"Received shot end for shot ID {reported_shot_id} while shot ID {shot_id} is in progress" ) - case ShotExitMessage(message=message, code=code) as exit_msg: + case ShotExitMessage() as exit_msg: shot_status = ShotStatus.ENDING yield exit_msg - case FullPanicMessage(message=message, code=code): + case FullPanicMessage() as panic: shot_status = ShotStatus.ENDING - raise SelenePanicError(message=message, code=code) + yield panic case other: # all other entries, such as user results, state results, metadata, etc # are expected strictly within shot boundaries. diff --git a/selene-sim/python/selene_sim/result_handling/parse_shot.py b/selene-sim/python/selene_sim/result_handling/parse_shot.py index 65c37aac..f0cb59e2 100644 --- a/selene-sim/python/selene_sim/result_handling/parse_shot.py +++ b/selene-sim/python/selene_sim/result_handling/parse_shot.py @@ -7,6 +7,7 @@ SeleneRuntimeError, SeleneStartupError, SeleneTimeoutError, + StackTrace, ) from .result_stream import ResultStream, TaggedResult from .exception_encoding import ( @@ -19,6 +20,8 @@ UserResult, UserStateResult, ShotExitMessage, + FullPanicMessage, + DebugTraceMessage, MetricValue, InstructionLogEntry, ShotMeasurements, @@ -65,6 +68,8 @@ def parsed_interface( also raised, with contextual information via the stdout and stderr corresponding to the process that is feeding the results stream. """ + stack_trace = StackTrace() + pending_panic: SelenePanicError | None = None try: for entry in shot_entries: match entry: @@ -84,6 +89,8 @@ def parsed_interface( # TODO: this is a string, but TaggedResult currently expects an int, # float, bool, or a list of those. yield ((tag_split[1], path)) # type: ignore + case DebugTraceMessage(module=module, address=address): + stack_trace.add_entry(module=module, address=address) case ShotExitMessage(message=message, code=code): message_split = message.split(":", maxsplit=2) if len(message_split) != 3: @@ -91,13 +98,21 @@ def parsed_interface( f"Expected exit message tag to have three parts, got {message}" ) yield ((f"exit: {message_split[2]}", code)) + case FullPanicMessage(message=message, code=code): + if pending_panic is None: + pending_panic = SelenePanicError(message=message, code=code) case MetricValue(name=name, value=value): event_hook.try_invoke(name, [value]) - case InstructionLogEntry(tag=tag, values=values) as entry: + case InstructionLogEntry(tag=tag, values=values): event_hook.try_invoke(tag, values) case ShotMeasurements(tag=tag, values=values): event_hook.try_invoke(tag, values) - except Exception as error: + if pending_panic is not None: + raise pending_panic + except Exception as caught_error: + # Once a panic has been reported, failures while draining the remainder + # of the shot must not mask it. + error = pending_panic or caught_error # taint the stream to prevent further reading stream.taint() @@ -121,8 +136,10 @@ def parsed_interface( error, (SeleneStartupError, SelenePanicError) ) ) + stack_trace.symbolize(process.executable) error.stdout = process.stdout.read_text() error.stderr = process.stderr.read_text() + error.stack_trace = stack_trace raise error from None @@ -146,6 +163,8 @@ def unparsed_interface( are encountered, they are caught and encoded with special tags such that they can be decoded further down the line (e.g. with postprocess_unparsed_stream). """ + stack_trace: StackTrace = StackTrace() + pending_panic: SelenePanicError | None = None try: for entry in shot_entries: match entry: @@ -157,8 +176,13 @@ def unparsed_interface( ) case ShotExitMessage(message=message, code=code): yield ((message, code)) + case FullPanicMessage(message=message, code=code): + if pending_panic is None: + pending_panic = SelenePanicError(message=message, code=code) case MetricValue(name=name, value=value): yield ((name, value)) + case DebugTraceMessage(module=module, address=address): + stack_trace.add_entry(module=module, address=address) case InstructionLogEntry(): raise SeleneRuntimeError( "Instruction log entries are not compatible with selene's unparsed interface" @@ -169,15 +193,24 @@ def unparsed_interface( raise SeleneRuntimeError( "Measurement log entries are not compatible with selene's unparsed interface" ) - except Exception as e: + if pending_panic is not None: + raise pending_panic + except Exception as caught_error: + # Preserve a reported panic if draining its supplementary records fails. + error = pending_panic or caught_error # taint the stream to prevent further reading stream.taint() process.terminate( - expected_natural_exit=isinstance(e, (SelenePanicError, SeleneStartupError)) + expected_natural_exit=isinstance( + error, (SelenePanicError, SeleneStartupError) + ) ) process.wait(check_return_code=False) + # This machine has the executable and its debug artifacts. Symbolize + # before encoding the exception for transport to another machine. + stack_trace.symbolize(process.executable) # encode the exception as tagged results - yield from encode_exception(e, process.stdout, process.stderr) + yield from encode_exception(error, process.stdout, process.stderr, stack_trace) # Post-processing for unparsed streams diff --git a/selene-sim/python/selene_sim/stack_trace.py b/selene-sim/python/selene_sim/stack_trace.py new file mode 100644 index 00000000..e57cba65 --- /dev/null +++ b/selene-sim/python/selene_sim/stack_trace.py @@ -0,0 +1,183 @@ +import json +import platform +from dataclasses import dataclass, field +from pathlib import Path +from subprocess import PIPE, CalledProcessError, run +from typing import Optional + + +def create_dsym(executable: Path) -> Path | None: + """Create or reuse a dSYM bundle without exposing failures to the caller.""" + dist_dir = Path(__file__).parent / "_dist" + dsym_path = Path(f"{executable}.dSYM") + try: + if ( + dsym_path.exists() + and dsym_path.stat().st_mtime >= executable.stat().st_mtime + ): + return dsym_path + run( + [ + str(dist_dir / "bin/dsymutil"), + "-o", + str(dsym_path), + str(executable), + ], + stdout=PIPE, + stderr=PIPE, + check=True, + ) + except (OSError, CalledProcessError): + return None + return dsym_path + + +def run_llvm_symbolizer( + module: Path, + addresses: list[int], + dsym_hint: Path | None = None, +) -> tuple[list[dict] | None, str | None]: + """Runs llvm-symbolizer on the given module for the given addresses. + + Returns the decoded output and no failure step on success, or no output and a + concise description of the failed step. Failure is not considered exceptional. + """ + assert module + dist_dir = Path(__file__).parent / "_dist" + llvm_symbolizer = dist_dir / "bin/llvm-symbolizer" + if platform.system() == "Windows": + llvm_symbolizer = llvm_symbolizer.with_suffix(".exe") + + command = [ + f"{llvm_symbolizer}", + "--functions=short", + "--inlines", + "--output-style=JSON", + f"--obj={module}", + ] + if platform.system() == "Windows": + # Windows stack frames contain RVAs. llvm-symbolizer will add the PE + # image base before looking them up. + command.append("--relative-address") + if dsym_hint is not None: + command.append(f"--dsym-hint={dsym_hint}") + command += [f"{address:#x}" for address in addresses] + try: + result = run(command, stdout=PIPE, stderr=PIPE, check=True, text=True) + except (OSError, CalledProcessError): + return None, "running llvm-symbolizer" + try: + output = json.loads(result.stdout) + if not isinstance(output, list): + return None, "reading llvm-symbolizer output" + return output, None + except json.JSONDecodeError: + return None, "reading llvm-symbolizer output" + + +def extract_symbols_from_module( + module: Path, addresses: list[int], dsym_hint: Path | None = None +) -> tuple[list[dict] | None, str | None]: + """Tries to extract symbols from the given module for the given addresses using + llvm-symbolizer. + + Returns symbol information and any concise failure step. + """ + assert module + return run_llvm_symbolizer(module, addresses, dsym_hint) + + +@dataclass +class Symbol: + column: int + line: int + filename: str + function_name: str + + @classmethod + def from_llvm_symbolizer_dict(cls, data: dict) -> Optional["Symbol"]: + result = cls( + column=data.get("Column", 0), + line=data.get("Line", 0), + filename=data.get("FileName", ""), + function_name=data.get("FunctionName", ""), + ) + if result.line > 0: + # Only return symbols that have a valid line number, as these are meaningful for debugging. + return result + return None + + +@dataclass +class StackTraceEntry: + module: Path + address: int + symbols: list[Symbol] = field(default_factory=list) + + def __str__(self) -> str: + if self.symbols: + symbol_strs = [ + f"{symbol.function_name} ({symbol.filename}:{symbol.line}:{symbol.column})" + for symbol in self.symbols + ] + return f"{self.address:#x}: " + " -> ".join(symbol_strs) + else: + return f"{self.address:#x}: " + + +@dataclass +class StackTrace: + entries: list[StackTraceEntry] = field(default_factory=list) + symbolization_attempted: bool = False + symbolization_failure: str | None = None + + def __str__(self) -> str: + return "\n".join(f" at {entry}" for entry in self.entries if entry.symbols) + + def add_entry(self, module: Path, address: int) -> None: + self.entries.append(StackTraceEntry(module=module, address=address)) + + def symbolize(self, executable: Path) -> None: + if not self.entries: + return + self.symbolization_attempted = True + try: + dsym_hint = None + if platform.system() == "Darwin": + dsym_hint = create_dsym(executable) + if dsym_hint is None: + self.symbolization_failure = "creating macOS debug symbols" + + modules = {entry.module for entry in self.entries} + for module in modules: + relevant_entries = [ + entry for entry in self.entries if entry.module == module + ] + addresses = [entry.address for entry in relevant_entries] + all_symbols, failure = extract_symbols_from_module( + module, addresses, dsym_hint + ) + if failure is not None: + if self.symbolization_failure is None: + self.symbolization_failure = failure + continue + if all_symbols is None: + continue + + parsed_symbols: list[list[Symbol]] = [] + for entry, symbols in zip(relevant_entries, all_symbols, strict=True): + entry_symbols = [] + for symbol in symbols["Symbol"]: + parsed_symbol = Symbol.from_llvm_symbolizer_dict(symbol) + if parsed_symbol is not None: + entry_symbols.append(parsed_symbol) + parsed_symbols.append(entry_symbols) + for entry, entry_symbols in zip( + relevant_entries, parsed_symbols, strict=True + ): + entry.symbols = entry_symbols + except (AttributeError, KeyError, TypeError, ValueError): + self.symbolization_failure = "processing llvm-symbolizer output" + except Exception: + # Stack traces are supplementary: never mask the original exception. + self.symbolization_failure = "processing stack trace information" diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..dba6880a --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-aarch64-apple-darwin.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..96850a7f --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..bbebbf8c --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-apple-darwin.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..26701661 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..22155cfd --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-helios-x86_64-windows-gnu.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..dba6880a --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-aarch64-apple-darwin.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..96850a7f --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..bbebbf8c --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-apple-darwin.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..26701661 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..22155cfd --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic-sol-x86_64-windows-gnu.ll @@ -0,0 +1,50 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"s_This shoul.4464F519.0" = private constant [25 x i8] c"\18This should always panic" + +; Function Attrs: noreturn +define void @__hugr__.__main__.main.1() local_unnamed_addr #0 !dbg !4 { +alloca_block: + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !8 + unreachable +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +; Function Attrs: noreturn +define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { +entry: + tail call void @setup(i64 %0), !dbg !14 + tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + unreachable +} + +declare void @setup(i64) local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 11, type: !6, scopeLine: 12, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 7, column: 4, scope: !4) +!9 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !10, type: !11, spFlags: DISPFlagDefinition, unit: !1) +!10 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!11 = !DISubroutineType(types: !12) +!12 = !{!13, !13} +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DILocation(line: 0, scope: !9) +!15 = !DILocation(line: 7, column: 4, scope: !4, inlinedAt: !16) +!16 = distinct !DILocation(line: 0, scope: !9) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic.sha256 b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic.sha256 new file mode 100644 index 00000000..e7b3eca7 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_always_panic/panic.sha256 @@ -0,0 +1 @@ +fa91e156a033e5a63521865fc21ce28dd884b675627b7a62fd60bfea8c03e2f3 \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..e1bfee8c --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-aarch64-apple-darwin.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rxy(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rzz(i64, i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..94a034cc --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rxy(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rzz(i64, i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..a9341315 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-apple-darwin.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rxy(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rzz(i64, i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..a6ab3d12 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rxy(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rzz(i64, i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..69335f29 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-helios-x86_64-windows-gnu.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_helios_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_helios_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rxy(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_helios_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rzz(i64, i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..0a66543e --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-aarch64-apple-darwin.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %0, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..55cf99de --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %0, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..5c7890de --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-apple-darwin.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %0, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..ba76aa37 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %0, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..6f8a3d0b --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic-sol-x86_64-windows-gnu.ll @@ -0,0 +1,133 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@res_q.B83B1738.0 = private constant [12 x i8] c"\0BUSER:BOOL:q" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !8 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %0 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 1000), !dbg !9 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !10 + tail call void @___qfree(i64 %qalloc.i), !dbg !10 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !10 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !11 + ret void +} + +define internal fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 returned %0, i64 %1) unnamed_addr !dbg !12 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !16 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !16 + br i1 %not_max.not.not.i, label %cond_59_case_0.i, label %__hugr__.__tk2_sol_qalloc.55.exit, !dbg !16 + +cond_59_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !16 + unreachable, !dbg !16 + +__hugr__.__tk2_sol_qalloc.55.exit: ; preds = %alloca_block + %2 = icmp sgt i64 %1, 0, !dbg !17 + tail call void @___reset(i64 %qalloc.i), !dbg !16 + tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %0, i64 %qalloc.i, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %0, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %0, double 0xBFF921FB54442D18) + br i1 %2, label %4, label %3 + +3: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit, %4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !18 + tail call void @___qfree(i64 %qalloc.i), !dbg !18 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !18 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !18 + tail call void @print_bool(ptr nonnull @res_q.B83B1738.0, i64 11, i1 %read_bool), !dbg !19 + ret i64 %0 + +4: ; preds = %__hugr__.__tk2_sol_qalloc.55.exit + %5 = add nsw i64 %1, -1, !dbg !20 + %6 = tail call fastcc i64 @__hugr__.__main__.recursive_cx.12(i64 %qalloc.i, i64 %5), !dbg !21 + br label %3 +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !22 { +entry: + tail call void @setup(i64 %0), !dbg !26 + tail call void @__hugr__.__main__.main.1(), !dbg !26 + %1 = tail call i64 @teardown(), !dbg !26 + ret i64 %1, !dbg !26 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 20, type: !6, scopeLine: 21, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 21, column: 8, scope: !4) +!9 = !DILocation(line: 23, column: 4, scope: !4) +!10 = !DILocation(line: 25, column: 16, scope: !4) +!11 = !DILocation(line: 25, column: 4, scope: !4) +!12 = distinct !DISubprogram(name: "recursive_cx", linkageName: "__hugr__.__main__.recursive_cx.12", scope: null, file: !5, line: 6, type: !13, scopeLine: 7, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 7, column: 8, scope: !12) +!17 = !DILocation(line: 10, column: 7, scope: !12) +!18 = !DILocation(line: 13, column: 16, scope: !12) +!19 = !DILocation(line: 13, column: 4, scope: !12) +!20 = !DILocation(line: 11, column: 24, scope: !12) +!21 = !DILocation(line: 11, column: 8, scope: !12) +!22 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !23, type: !24, spFlags: DISPFlagDefinition, unit: !1) +!23 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!24 = !DISubroutineType(types: !25) +!25 = !{!15, !15} +!26 = !DILocation(line: 0, scope: !22) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic.sha256 b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic.sha256 new file mode 100644 index 00000000..9ff5643c --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_qalloc/panic.sha256 @@ -0,0 +1 @@ +5c71eb37b78a91e43ad04f26f9badc408a747df522cf576db7a4d3c5e9d4a6d1 \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..d129e82d --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-aarch64-apple-darwin.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..59ae7f73 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..0c3b1eed --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-apple-darwin.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..15a5b369 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..30a36aea --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-helios-x86_64-windows-gnu.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..0b22678c --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-aarch64-apple-darwin.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..19e05abd --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..8991f1f3 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-apple-darwin.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..5e39f68f --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..e5e7f97f --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic-sol-x86_64-windows-gnu.ll @@ -0,0 +1,90 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"s_The bad ev.D06D9A5E.0" = private constant [33 x i8] c" The bad event has been triggered" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr !dbg !4 { +alloca_block: + %qalloc.i = tail call i64 @___qalloc(), !dbg !8 + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !8 + br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit, !dbg !8 + +cond_34_case_0.i: ; preds = %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !8 + unreachable, !dbg !8 + +__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i), !dbg !8 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !9 + tail call void @___qfree(i64 %qalloc.i), !dbg !9 + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure), !dbg !9 + tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !9 + br i1 %read_bool, label %0, label %1 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + tail call void @panic(i32 1001, ptr nonnull @"s_The bad ev.D06D9A5E.0"), !dbg !10 + unreachable + +1: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit + ret void +} + +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @___dec_future_refcount(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare void @___rz(i64, double) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !11 { +entry: + tail call void @setup(i64 %0), !dbg !16 + tail call void @__hugr__.__main__.main.1(), !dbg !16 + %1 = tail call i64 @teardown(), !dbg !16 + ret i64 %1, !dbg !16 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} +!name = !{!3} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "guppylang (guppylang-internals-v1.0.2)-v1.0.2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/sanitized/path/program.py", directory: "/sanitized/path") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "main", linkageName: "__hugr__.__main__.main.1", scope: null, file: !5, line: 12, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/sanitized/path/program.py", directory: "") +!6 = !DISubroutineType(types: !7) +!7 = !{null} +!8 = !DILocation(line: 13, column: 8, scope: !4) +!9 = !DILocation(line: 7, column: 7, scope: !4) +!10 = !DILocation(line: 8, column: 8, scope: !4) +!11 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !12, type: !13, spFlags: DISPFlagDefinition, unit: !1) +!12 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!13 = !DISubroutineType(types: !14) +!14 = !{!15, !15} +!15 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 0, scope: !11) diff --git a/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic.sha256 b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic.sha256 new file mode 100644 index 00000000..8d4a6cf1 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_backtrace/test_backtrace_sometimes_panic/panic.sha256 @@ -0,0 +1 @@ +7f11fa5d3ac1f446fbd878911c29861b2bb7fa7b562b488a145a721dcce136e2 \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-apple-darwin.ll index 56684f92..ecdeddf4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-unknown-linux-gnu.ll index 981bc272..5d60cc64 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-apple-darwin.ll index b6b27efa..054fa154 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-unknown-linux-gnu.ll index 547d76cb..1b49a1c5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-windows-gnu.ll index df3c9952..f3a5fba1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-helios-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-apple-darwin.ll index 077367a7..d2a54905 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-unknown-linux-gnu.ll index a4c84982..01e90297 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-apple-darwin.ll index 9804363f..9742d306 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-unknown-linux-gnu.ll index 209f81da..19ecb32d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-windows-gnu.ll index 841edce5..7e36f7ad 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config0]/strict_build_default-sol-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-apple-darwin.ll index 56684f92..ecdeddf4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-unknown-linux-gnu.ll index 981bc272..5d60cc64 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-apple-darwin.ll index b6b27efa..054fa154 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-unknown-linux-gnu.ll index 547d76cb..1b49a1c5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-windows-gnu.ll index df3c9952..f3a5fba1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-helios-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-apple-darwin.ll index 077367a7..d2a54905 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-unknown-linux-gnu.ll index a4c84982..01e90297 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-apple-darwin.ll index 9804363f..9742d306 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-unknown-linux-gnu.ll index 209f81da..19ecb32d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-windows-gnu.ll index 841edce5..7e36f7ad 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config1]/strict_build_llvm_ir-sol-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-apple-darwin.ll index 56684f92..ecdeddf4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-unknown-linux-gnu.ll index 981bc272..5d60cc64 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-apple-darwin.ll index b6b27efa..054fa154 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-unknown-linux-gnu.ll index 547d76cb..1b49a1c5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-windows-gnu.ll index df3c9952..f3a5fba1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-helios-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-apple-darwin.ll index 077367a7..d2a54905 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-unknown-linux-gnu.ll index a4c84982..01e90297 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-apple-darwin.ll index 9804363f..9742d306 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-unknown-linux-gnu.ll index 209f81da..19ecb32d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-windows-gnu.ll index 841edce5..7e36f7ad 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_build_validation/test_strict_builds_guppy[build_config2]/strict_build_llvm_bc-sol-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-apple-darwin.ll index 56684f92..ecdeddf4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-unknown-linux-gnu.ll index 981bc272..5d60cc64 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-apple-darwin.ll index b6b27efa..054fa154 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-unknown-linux-gnu.ll index 547d76cb..1b49a1c5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-windows-gnu.ll index df3c9952..f3a5fba1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-helios-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_helios_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-apple-darwin.ll index 077367a7..d2a54905 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-unknown-linux-gnu.ll index a4c84982..01e90297 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-apple-darwin.ll index 9804363f..9742d306 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-unknown-linux-gnu.ll index 209f81da..19ecb32d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-windows-gnu.ll index 841edce5..7e36f7ad 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_cleanup/test_file_deletion/file_deletion-sol-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit + br i1 %not_max.not.not.i, label %cond_10_case_0.i, label %__hugr__.__tk2_sol_qalloc.6.exit -cond_17_case_0.i: ; preds = %alloca_block +cond_10_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.6.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) ret void @@ -35,9 +35,9 @@ entry: tail call void @setup(i64 %0) %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_17_case_0.i.i, label %__hugr__.__main__.main.1.exit + br i1 %not_max.not.not.i.i, label %cond_10_case_0.i.i, label %__hugr__.__main__.main.1.exit -cond_17_case_0.i.i: ; preds = %entry +cond_10_case_0.i.i: ; preds = %entry tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll deleted file mode 100644 index 4b2cf6ed..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index ab354192..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll deleted file mode 100644 index bdf00b78..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index b809eaff..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll deleted file mode 100644 index b76c8b36..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll deleted file mode 100644 index 25f5c5ba..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index 9119e849..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll deleted file mode 100644 index 83b90823..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index 62ff57b5..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll deleted file mode 100644 index 71c6b1be..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll deleted file mode 100644 index 4b2cf6ed..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index ab354192..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll deleted file mode 100644 index bdf00b78..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index b809eaff..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll deleted file mode 100644 index b76c8b36..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_helios_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll deleted file mode 100644 index 25f5c5ba..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index 9119e849..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll deleted file mode 100644 index 83b90823..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index 62ff57b5..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll deleted file mode 100644 index 71c6b1be..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll +++ /dev/null @@ -1,324 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" -@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_287_case_0.i, label %__hugr__.__tk2_sol_qalloc.283.exit - -cond_287_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.283.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.283.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.283.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_287_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not257 = icmp eq i64 %6, 0 - br i1 %.not257, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i220, label %__barray_mask_borrow.exit - -panic.i220: ; preds = %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_mask_return.exit222, label %panic.i221 - -panic.i221: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit222: ; preds = %__barray_mask_borrow.exit - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = trunc i64 %16 to i1 - br i1 %17, label %panic.i223, label %__barray_mask_borrow.exit224 - -panic.i223: ; preds = %__barray_mask_return.exit222 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit224: ; preds = %__barray_mask_return.exit222 - %18 = or disjoint i64 %16, 1 - store i64 %18, ptr %1, align 4 - %19 = and i64 %16, 2 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %__barray_mask_borrow.exit226, label %panic.i225 - -panic.i225: ; preds = %__barray_mask_borrow.exit224 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit226: ; preds = %__barray_mask_borrow.exit224 - %20 = load i64, ptr %0, align 4 - %21 = or disjoint i64 %16, 3 - store i64 %21, ptr %1, align 4 - %22 = load i64, ptr %8, align 4 - %23 = tail call ptr @heap_alloc(i64 16) - %24 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %24, align 1 - store i64 %20, ptr %23, align 4 - %25 = getelementptr inbounds nuw i8, ptr %23, i64 8 - store i64 %22, ptr %25, align 4 - %26 = load i64, ptr %24, align 4 - %27 = and i64 %26, 3 - store i64 %27, ptr %24, align 4 - %28 = icmp eq i64 %27, 0 - br i1 %28, label %__barray_mask_check_not_borrowed.exit229, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit226 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit229: ; preds = %__barray_mask_borrow.exit226 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %29 = alloca [2 x i1], align 1 - store i1 false, ptr %29, align 1 - %.repack218 = getelementptr inbounds nuw i8, ptr %29, i64 1 - store i1 false, ptr %.repack218, align 1 - store i32 2, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %23, ptr %arr_ptr, align 8 - store ptr %29, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) - %30 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %30, align 1 - %31 = load i64, ptr %25, align 4 - %32 = load i64, ptr %1, align 4 - %33 = trunc i64 %32 to i1 - br i1 %33, label %__barray_mask_return.exit231, label %panic.i230 - -panic.i230: ; preds = %__barray_mask_check_not_borrowed.exit229 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit231: ; preds = %__barray_mask_check_not_borrowed.exit229 - %34 = load i64, ptr %23, align 4 - %35 = and i64 %32, -2 - store i64 %35, ptr %1, align 4 - store i64 %34, ptr %0, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 2 - %.not252 = icmp eq i64 %37, 0 - br i1 %.not252, label %panic.i232, label %__barray_mask_return.exit233 - -panic.i232: ; preds = %__barray_mask_return.exit231 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit233: ; preds = %__barray_mask_return.exit231 - %38 = and i64 %36, -3 - store i64 %38, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 2 - %.not253 = icmp eq i64 %40, 0 - br i1 %.not253, label %__barray_mask_borrow.exit235, label %panic.i234 - -panic.i234: ; preds = %__barray_mask_return.exit233 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit235: ; preds = %__barray_mask_return.exit233 - %41 = or disjoint i64 %39, 2 - store i64 %41, ptr %1, align 4 - %42 = trunc i64 %39 to i1 - br i1 %42, label %panic.i236, label %__barray_mask_borrow.exit237 - -panic.i236: ; preds = %__barray_mask_borrow.exit235 - call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit237: ; preds = %__barray_mask_borrow.exit235 - %43 = load i64, ptr %8, align 4 - %44 = or disjoint i64 %39, 3 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %0, align 4 - %46 = call ptr @heap_alloc(i64 16) - %47 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %47, align 1 - store i64 %43, ptr %46, align 4 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 8 - store i64 %45, ptr %48, align 4 - %49 = load i64, ptr %47, align 4 - %50 = and i64 %49, 3 - store i64 %50, ptr %47, align 4 - %51 = icmp eq i64 %50, 0 - br i1 %51, label %__barray_mask_check_not_borrowed.exit243, label %mask_block_err.i238 - -mask_block_err.i238: ; preds = %__barray_mask_borrow.exit237 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit243: ; preds = %__barray_mask_borrow.exit237 - %out_arr_alloca130 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr132 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 4 - %arr_ptr133 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 8 - %mask_ptr134 = getelementptr inbounds nuw i8, ptr %out_arr_alloca130, i64 16 - %52 = alloca [2 x i1], align 1 - store i1 false, ptr %52, align 1 - %.repack219 = getelementptr inbounds nuw i8, ptr %52, i64 1 - store i1 false, ptr %.repack219, align 1 - store i32 2, ptr %out_arr_alloca130, align 8 - store i32 1, ptr %y_ptr132, align 4 - store ptr %46, ptr %arr_ptr133, align 8 - store ptr %52, ptr %mask_ptr134, align 8 - call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca130) - %53 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %53, align 1 - %54 = load i64, ptr %48, align 4 - %55 = load i64, ptr %1, align 4 - %56 = and i64 %55, 2 - %.not254 = icmp eq i64 %56, 0 - br i1 %.not254, label %panic.i244, label %__barray_mask_return.exit245 - -panic.i244: ; preds = %__barray_mask_check_not_borrowed.exit243 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit245: ; preds = %__barray_mask_check_not_borrowed.exit243 - %57 = load i64, ptr %46, align 4 - %58 = and i64 %55, -3 - store i64 %58, ptr %1, align 4 - store i64 %57, ptr %8, align 4 - %59 = load i64, ptr %1, align 4 - %60 = trunc i64 %59 to i1 - br i1 %60, label %__barray_mask_return.exit247, label %panic.i246 - -panic.i246: ; preds = %__barray_mask_return.exit245 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit247: ; preds = %__barray_mask_return.exit245 - %61 = and i64 %59, -2 - store i64 %61, ptr %1, align 4 - store i64 %54, ptr %0, align 4 - %62 = load i64, ptr %1, align 4 - %63 = trunc i64 %62 to i1 - br i1 %63, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit247 - %64 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %62, %__barray_mask_return.exit247 ] - %65 = and i64 %64, 2 - %.not.i = icmp eq i64 %65, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_199.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %66 = or disjoint i64 %64, 2 - store i64 %66, ptr %1, align 4 - %67 = load i64, ptr %8, align 4 - call void @___qfree(i64 %67) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_199.i - -cond_exit_199.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %68 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %64, %__barray_check_bounds.exit.1.i ] - %69 = or i64 %68, -4 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.discard_array$2.157.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_199.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit247 - %71 = or disjoint i64 %62, 1 - store i64 %71, ptr %1, align 4 - %72 = load i64, ptr %0, align 4 - call void @___qfree(i64 %72) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.157.exit": ; preds = %cond_exit_199.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll deleted file mode 100644 index 36370258..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index d85e357c..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll deleted file mode 100644 index 15a4ba8f..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index fc22bdd5..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll deleted file mode 100644 index aa0155f7..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll deleted file mode 100644 index c8ac497d..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index cf3b49f1..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll deleted file mode 100644 index c3165a5c..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index 024feee5..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll deleted file mode 100644 index bc9b9d7d..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll deleted file mode 100644 index 36370258..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index d85e357c..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll deleted file mode 100644 index 15a4ba8f..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index fc22bdd5..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll deleted file mode 100644 index aa0155f7..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rxy(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll deleted file mode 100644 index c8ac497d..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll deleted file mode 100644 index cf3b49f1..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" -target triple = "aarch64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll deleted file mode 100644 index c3165a5c..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-apple-darwin" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll deleted file mode 100644 index 024feee5..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll deleted file mode 100644 index bc9b9d7d..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll +++ /dev/null @@ -1,229 +0,0 @@ -; ModuleID = 'hugr' -source_filename = "hugr" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -target triple = "x86_64-windows-gnu" - -@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" -@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." - -define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: - %0 = tail call ptr @heap_alloc(i64 16) - %1 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %1, align 1 - %qalloc.i = tail call i64 @___qalloc() - %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit - -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable - -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i - -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 - -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 - -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 - -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 - %22 = and i64 %20, -3 - store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 - %23 = load i64, ptr %1, align 4 - %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 - -panic.i341: ; preds = %__barray_mask_return.exit340.1 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 - %25 = or disjoint i64 %23, 1 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %0, align 4 - %27 = tail call ptr @heap_alloc(i64 8) - %28 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %28, align 1 - store i64 %26, ptr %27, align 4 - %29 = load i64, ptr %28, align 4 - %30 = and i64 %29, 1 - store i64 %30, ptr %28, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %32 = alloca i1, align 1 - store i1 false, ptr %32, align 1 - store i32 1, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %27, ptr %arr_ptr, align 8 - store ptr %32, ptr %mask_ptr, align 8 - call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) - %33 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %33, align 1 - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 - -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit - %36 = load i64, ptr %27, align 4 - %37 = and i64 %34, -2 - store i64 %37, ptr %1, align 4 - store i64 %36, ptr %0, align 4 - %38 = load i64, ptr %1, align 4 - %39 = trunc i64 %38 to i1 - br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i - -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] - %41 = and i64 %40, 2 - %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i - -__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i - %42 = or disjoint i64 %40, 2 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 - call void @___qfree(i64 %43) - %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i - -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i - %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] - %45 = or i64 %44, -4 - store i64 %45, ptr %1, align 4 - %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i - -mask_block_err.i.i: ; preds = %cond_exit_231.i - call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 - %47 = or disjoint i64 %38, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 - br label %__barray_check_bounds.exit.1.i - -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i - call void @heap_free(ptr nonnull %0) - call void @heap_free(ptr nonnull %1) - ret void -} - -declare ptr @heap_alloc(i64) local_unnamed_addr - -; Function Attrs: noreturn -declare void @panic(i32, ptr) local_unnamed_addr #0 - -declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @___rp(i64, double, double) local_unnamed_addr - -declare i64 @___qalloc() local_unnamed_addr - -declare void @___reset(i64) local_unnamed_addr - -define i64 @qmain(i64 %0) local_unnamed_addr { -entry: - tail call void @setup(i64 %0) - tail call void @__hugr__.__main__.main.1() - %1 = tail call i64 @teardown() - ret i64 %1 -} - -declare void @setup(i64) local_unnamed_addr - -declare i64 @teardown() local_unnamed_addr - -attributes #0 = { noreturn } - -!name = !{!0} - -!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx]/stim_gate_implementation_rx.sha256 b/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx]/stim_gate_implementation_rx.sha256 deleted file mode 100644 index 8445b98a..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx]/stim_gate_implementation_rx.sha256 +++ /dev/null @@ -1 +0,0 @@ -e3b961a242b4bf66c23acc464bf67dbeb2a5f4bbd02039166331bf161e2471bd \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry]/stim_gate_implementation_ry.sha256 b/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry]/stim_gate_implementation_ry.sha256 deleted file mode 100644 index 48e6effd..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry]/stim_gate_implementation_ry.sha256 +++ /dev/null @@ -1 +0,0 @@ -63e203495775cc01b9126f7b0c303e704ac2681b4a2ea26e4f79b6e3c283cfae \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz]/stim_gate_implementation_rz.sha256 b/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz]/stim_gate_implementation_rz.sha256 deleted file mode 100644 index 7e62f8f6..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz]/stim_gate_implementation_rz.sha256 +++ /dev/null @@ -1 +0,0 @@ -769e391ac1ca7e58a69682f20cd2b8e485ec7c30593521c53744c19e45202b9d \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples.sha256 b/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples.sha256 deleted file mode 100644 index 092ffada..00000000 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples.sha256 +++ /dev/null @@ -1 +0,0 @@ -667a7ea4138e9c41cff0a1b57dda8b8f9b3a17155835161ff39ca977b35f9118 \ No newline at end of file diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-apple-darwin.ll index 04e5f7a9..d161afb1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-unknown-linux-gnu.ll index d0d02e7a..e1f47c54 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-aarch64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-apple-darwin.ll index 300a984b..3682f073 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-unknown-linux-gnu.ll index 21eb1561..2d9e1230 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-windows-gnu.ll index 3c682ff9..c25dd231 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-helios-x86_64-windows-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-apple-darwin.ll index b39efd10..75d57d8a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-unknown-linux-gnu.ll index b61ac1d0..25b601f4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-aarch64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-apple-darwin.ll index 57c42175..12222304 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-unknown-linux-gnu.ll index 3e66b2f2..e3f29817 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-windows-gnu.ll index 2a272324..a4461930 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_1q_error/depolarising_1q_error-sol-x86_64-windows-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-apple-darwin.ll index 04e5f7a9..d161afb1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-unknown-linux-gnu.ll index d0d02e7a..e1f47c54 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-aarch64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-apple-darwin.ll index 300a984b..3682f073 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-unknown-linux-gnu.ll index 21eb1561..2d9e1230 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-windows-gnu.ll index 3c682ff9..c25dd231 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-helios-x86_64-windows-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_helios_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_helios_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_helios_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %__hugr__.__tk2_helios_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i22, double 0xBFF921FB54442D18) +__hugr__.__tk2_helios_qalloc.13.exit17: ; preds = %__hugr__.__tk2_helios_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-apple-darwin.ll index b39efd10..75d57d8a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-unknown-linux-gnu.ll index b61ac1d0..25b601f4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-aarch64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-apple-darwin.ll index 57c42175..12222304 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-apple-darwin.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-unknown-linux-gnu.ll index 3e66b2f2..e3f29817 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-unknown-linux-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-windows-gnu.ll index 2a272324..a4461930 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_2q_error/depolarising_2q_error-sol-x86_64-windows-gnu.ll @@ -11,47 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_34_case_0.i, label %__hugr__.__tk2_sol_qalloc.30.exit + br i1 %not_max.not.not.i, label %cond_17_case_0.i, label %__hugr__.__tk2_sol_qalloc.13.exit -cond_34_case_0.i: ; preds = %alloca_block +cond_17_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.30.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.13.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i22 = tail call i64 @___qalloc() - %not_max.not.not.i23 = icmp eq i64 %qalloc.i22, -1 - br i1 %not_max.not.not.i23, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + %qalloc.i14 = tail call i64 @___qalloc() + %not_max.not.not.i15 = icmp eq i64 %qalloc.i14, -1 + br i1 %not_max.not.not.i15, label %cond_17_case_0.i16, label %__hugr__.__tk2_sol_qalloc.13.exit17 -cond_48_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit +cond_17_case_0.i16: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %__hugr__.__tk2_sol_qalloc.30.exit - tail call void @___reset(i64 %qalloc.i22) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i22, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i22, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i22, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.13.exit17: ; preds = %__hugr__.__tk2_sol_qalloc.13.exit + tail call void @___reset(i64 %qalloc.i14) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure13 = tail call i64 @___lazy_measure(i64 %qalloc.i22) - tail call void @___qfree(i64 %qalloc.i22) - %read_bool15 = tail call i1 @___read_future_bool(i64 %lazy_measure13) - tail call void @___dec_future_refcount(i64 %lazy_measure13) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool15) + %lazy_measure7 = tail call i64 @___lazy_measure(i64 %qalloc.i14) + tail call void @___qfree(i64 %qalloc.i14) + %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure7) + tail call void @___dec_future_refcount(i64 %lazy_measure7) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool9) ret void } @@ -74,10 +62,6 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - -declare void @___rz(i64, double) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-apple-darwin.ll index 34168f8a..5390ee04 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-apple-darwin.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_helios_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_helios_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_helios_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_helios_qalloc.12.exit16: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-unknown-linux-gnu.ll index e94a5aed..b452a06e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-aarch64-unknown-linux-gnu.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_helios_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_helios_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_helios_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_helios_qalloc.12.exit16: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-apple-darwin.ll index d34b7d3a..4f5908f1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-apple-darwin.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_helios_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_helios_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_helios_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_helios_qalloc.12.exit16: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-unknown-linux-gnu.ll index 8d4ac763..ef0c5554 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-unknown-linux-gnu.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_helios_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_helios_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_helios_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_helios_qalloc.12.exit16: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-windows-gnu.ll index 6e2e8155..db0a6bb6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-helios-x86_64-windows-gnu.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_helios_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_helios_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_helios_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %__hugr__.__tk2_helios_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_helios_qalloc.12.exit16: ; preds = %__hugr__.__tk2_helios_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-apple-darwin.ll index 8a33e42d..96dc84dd 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-apple-darwin.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_sol_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_sol_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_sol_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_sol_qalloc.12.exit16: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-unknown-linux-gnu.ll index 7b7e1373..54423aee 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-aarch64-unknown-linux-gnu.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_sol_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_sol_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_sol_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_sol_qalloc.12.exit16: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-apple-darwin.ll index b220f06d..d90c0a09 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-apple-darwin.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_sol_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_sol_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_sol_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_sol_qalloc.12.exit16: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-unknown-linux-gnu.ll index 08e6e50a..4ed6a335 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-unknown-linux-gnu.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_sol_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_sol_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_sol_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_sol_qalloc.12.exit16: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-windows-gnu.ll index 6a5512b1..46f38d7c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_init_error/depolarising_init_error-sol-x86_64-windows-gnu.ll @@ -11,31 +11,31 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_24_case_0.i, label %__hugr__.__tk2_sol_qalloc.20.exit + br i1 %not_max.not.not.i, label %cond_16_case_0.i, label %__hugr__.__tk2_sol_qalloc.12.exit -cond_24_case_0.i: ; preds = %alloca_block +cond_16_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.20.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.12.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i15 = tail call i64 @___qalloc() - %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 - br i1 %not_max.not.not.i16, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit + %qalloc.i13 = tail call i64 @___qalloc() + %not_max.not.not.i14 = icmp eq i64 %qalloc.i13, -1 + br i1 %not_max.not.not.i14, label %cond_16_case_0.i15, label %__hugr__.__tk2_sol_qalloc.12.exit16 -cond_38_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit +cond_16_case_0.i15: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %__hugr__.__tk2_sol_qalloc.20.exit - tail call void @___reset(i64 %qalloc.i15) +__hugr__.__tk2_sol_qalloc.12.exit16: ; preds = %__hugr__.__tk2_sol_qalloc.12.exit + tail call void @___reset(i64 %qalloc.i13) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i15) - tail call void @___qfree(i64 %qalloc.i15) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i13) + tail call void @___qfree(i64 %qalloc.i13) %read_bool8 = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-apple-darwin.ll index 6e2a60cc..254fcaaf 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-apple-darwin.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_helios_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_helios_qalloc.14.exit18: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-unknown-linux-gnu.ll index aeebf57e..176c54ea 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-aarch64-unknown-linux-gnu.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_helios_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_helios_qalloc.14.exit18: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-apple-darwin.ll index 975f73d3..b9714f8f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-apple-darwin.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_helios_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_helios_qalloc.14.exit18: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-unknown-linux-gnu.ll index e4a6e01a..eac02ba6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-unknown-linux-gnu.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_helios_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_helios_qalloc.14.exit18: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-windows-gnu.ll index becf4d85..b2370d57 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-helios-x86_64-windows-gnu.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_helios_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_helios_qalloc.14.exit18: ; preds = %__hugr__.__tk2_helios_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-apple-darwin.ll index 6697e9d0..e25b91d9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-apple-darwin.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_sol_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_sol_qalloc.14.exit18: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-unknown-linux-gnu.ll index ca2b8e83..d206c2c1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-aarch64-unknown-linux-gnu.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_sol_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_sol_qalloc.14.exit18: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-apple-darwin.ll index de24f9bf..44982308 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-apple-darwin.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_sol_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_sol_qalloc.14.exit18: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-unknown-linux-gnu.ll index fc8c4e65..890ef7aa 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-unknown-linux-gnu.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_sol_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_sol_qalloc.14.exit18: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-windows-gnu.ll index 9c1ea364..ee6a3163 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_depolarising_error_model/test_measurement_error/depolarising_measurement_error-sol-x86_64-windows-gnu.ll @@ -11,35 +11,35 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit + br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit -cond_28_case_0.i: ; preds = %alloca_block +cond_18_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i17 = tail call i64 @___qalloc() - %not_max.not.not.i18 = icmp eq i64 %qalloc.i17, -1 - br i1 %not_max.not.not.i18, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + %qalloc.i15 = tail call i64 @___qalloc() + %not_max.not.not.i16 = icmp eq i64 %qalloc.i15, -1 + br i1 %not_max.not.not.i16, label %cond_18_case_0.i17, label %__hugr__.__tk2_sol_qalloc.14.exit18 -cond_42_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit +cond_18_case_0.i17: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit - tail call void @___reset(i64 %qalloc.i17) +__hugr__.__tk2_sol_qalloc.14.exit18: ; preds = %__hugr__.__tk2_sol_qalloc.14.exit + tail call void @___reset(i64 %qalloc.i15) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i17, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i17, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i15, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i15, double 0x400921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool) - %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i17) - tail call void @___qfree(i64 %qalloc.i17) + %lazy_measure8 = tail call i64 @___lazy_measure(i64 %qalloc.i15) + tail call void @___qfree(i64 %qalloc.i15) %read_bool10 = tail call i1 @___read_future_bool(i64 %lazy_measure8) tail call void @___dec_future_refcount(i64 %lazy_measure8) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool10) diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-apple-darwin.ll index c7b64a7d..0ecde1d0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-apple-darwin.ll @@ -17,579 +17,589 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_helios_qalloc.571.exit.3, %__hugr__.__tk2_helios_qalloc.571.exit.2, %__hugr__.__tk2_helios_qalloc.571.exit.1, %__hugr__.__tk2_helios_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_helios_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_helios_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_helios_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rxy(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rxy(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-unknown-linux-gnu.ll index d8219033..eac072dc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-aarch64-unknown-linux-gnu.ll @@ -17,579 +17,589 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_helios_qalloc.571.exit.3, %__hugr__.__tk2_helios_qalloc.571.exit.2, %__hugr__.__tk2_helios_qalloc.571.exit.1, %__hugr__.__tk2_helios_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_helios_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_helios_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_helios_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rxy(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rxy(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-apple-darwin.ll index 196d8409..a7b5f348 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-apple-darwin.ll @@ -17,579 +17,589 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_helios_qalloc.571.exit.3, %__hugr__.__tk2_helios_qalloc.571.exit.2, %__hugr__.__tk2_helios_qalloc.571.exit.1, %__hugr__.__tk2_helios_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_helios_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_helios_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_helios_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rxy(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rxy(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-unknown-linux-gnu.ll index 8af13a50..2b6935e1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-unknown-linux-gnu.ll @@ -17,579 +17,589 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_helios_qalloc.571.exit.3, %__hugr__.__tk2_helios_qalloc.571.exit.2, %__hugr__.__tk2_helios_qalloc.571.exit.1, %__hugr__.__tk2_helios_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_helios_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_helios_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_helios_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rxy(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rxy(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-windows-gnu.ll index 5b8e68d2..b021aa27 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-helios-x86_64-windows-gnu.ll @@ -17,579 +17,589 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_helios_qalloc.571.exit.3, %__hugr__.__tk2_helios_qalloc.571.exit.2, %__hugr__.__tk2_helios_qalloc.571.exit.1, %__hugr__.__tk2_helios_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_helios_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_helios_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_helios_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_helios_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rxy(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rxy(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-apple-darwin.ll index 670a0798..a87be65a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-apple-darwin.ll @@ -17,579 +17,589 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_sol_qalloc.571.exit.3, %__hugr__.__tk2_sol_qalloc.571.exit.2, %__hugr__.__tk2_sol_qalloc.571.exit.1, %__hugr__.__tk2_sol_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_sol_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_sol_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_sol_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rp(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-unknown-linux-gnu.ll index c30fdeae..25da2c5a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-aarch64-unknown-linux-gnu.ll @@ -17,579 +17,589 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_sol_qalloc.571.exit.3, %__hugr__.__tk2_sol_qalloc.571.exit.2, %__hugr__.__tk2_sol_qalloc.571.exit.1, %__hugr__.__tk2_sol_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_sol_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_sol_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_sol_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rp(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-apple-darwin.ll index 8ec912cb..75844187 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-apple-darwin.ll @@ -17,579 +17,589 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_sol_qalloc.571.exit.3, %__hugr__.__tk2_sol_qalloc.571.exit.2, %__hugr__.__tk2_sol_qalloc.571.exit.1, %__hugr__.__tk2_sol_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_sol_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_sol_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_sol_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rp(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-unknown-linux-gnu.ll index 17bf9e69..57145ec1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-unknown-linux-gnu.ll @@ -17,579 +17,589 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_sol_qalloc.571.exit.3, %__hugr__.__tk2_sol_qalloc.571.exit.2, %__hugr__.__tk2_sol_qalloc.571.exit.1, %__hugr__.__tk2_sol_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_sol_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_sol_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_sol_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rp(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-windows-gnu.ll index 02193c66..3a96f1fd 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_determinism/test_repetition/determinism_repetition-sol-x86_64-windows-gnu.ll @@ -17,579 +17,589 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 40) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %shot = tail call i64 @get_current_shot() + tail call void @random_seed(i64 %shot) + %shot2 = tail call i64 @get_current_shot() + %2 = tail call ptr @heap_alloc(i64 40) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit + br i1 %not_max.not.not.i, label %cond_535_case_0.i, label %__barray_check_bounds.exit -cond_575_case_0.i: ; preds = %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_535_case_0.i: ; preds = %cond_104_case_1.4, %cond_104_case_1.3, %cond_104_case_1.2, %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.571.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.4, %__hugr__.__tk2_sol_qalloc.571.exit.3, %__hugr__.__tk2_sol_qalloc.571.exit.2, %__hugr__.__tk2_sol_qalloc.571.exit.1, %__hugr__.__tk2_sol_qalloc.571.exit +panic.i: ; preds = %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.1 + br i1 %not_max.not.not.i.1, label %cond_535_case_0.i, label %__barray_check_bounds.exit.1 -__hugr__.__tk2_sol_qalloc.571.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not766 = icmp eq i64 %6, 0 - br i1 %.not766, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not1178 = icmp eq i64 %8, 0 + br i1 %.not1178, label %panic.i, label %cond_104_case_1.2 + +cond_104_case_1.2: ; preds = %__barray_check_bounds.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.2 + br i1 %not_max.not.not.i.2, label %cond_535_case_0.i, label %__barray_check_bounds.exit.2 -__hugr__.__tk2_sol_qalloc.571.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_104_case_1.2 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not767 = icmp eq i64 %10, 0 - br i1 %.not767, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not1179 = icmp eq i64 %12, 0 + br i1 %.not1179, label %panic.i, label %cond_104_case_1.3 + +cond_104_case_1.3: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_575_case_0.i, label %__hugr__.__tk2_sol_qalloc.571.exit.3 + br i1 %not_max.not.not.i.3, label %cond_535_case_0.i, label %__barray_check_bounds.exit.3 -__hugr__.__tk2_sol_qalloc.571.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_104_case_1.3 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not768 = icmp eq i64 %14, 0 - br i1 %.not768, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.571.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %15 = load i64, ptr %3, align 4 + %16 = and i64 %15, 8 + %.not1180 = icmp eq i64 %16, 0 + br i1 %.not1180, label %panic.i, label %cond_104_case_1.4 + +cond_104_case_1.4: ; preds = %__barray_check_bounds.exit.3 + %17 = and i64 %15, -9 + store i64 %17, ptr %3, align 4 + %18 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %qalloc.i.3, ptr %18, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_575_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_535_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_104_case_1.4 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not769 = icmp eq i64 %18, 0 - br i1 %.not769, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %panic.i709, label %__barray_check_bounds.exit711 - -panic.i709: ; preds = %__barray_check_bounds.exit708.4, %__barray_mask_return.exit713.2, %__barray_mask_return.exit713.1, %__barray_mask_return.exit713, %cond_exit_20.4 + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 16 + %.not1181 = icmp eq i64 %20, 0 + br i1 %.not1181, label %panic.i, label %cond_exit_104.5 + +cond_exit_104.5: ; preds = %__barray_check_bounds.exit.4 + %21 = and i64 %19, -17 + store i64 %21, ptr %3, align 4 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 32 + store i64 %qalloc.i.4, ptr %22, align 4 + %.pre = load i64, ptr %3, align 4 + %23 = trunc i64 %.pre to i1 + br i1 %23, label %panic.i1116, label %__barray_check_bounds.exit1118 + +panic.i1116: ; preds = %__barray_check_bounds.exit1115.4, %__barray_mask_return.exit1120.2, %__barray_mask_return.exit1120.1, %__barray_mask_return.exit1120, %cond_exit_104.5 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit711: ; preds = %cond_exit_20.4 - %23 = or disjoint i64 %21, 1 - store i64 %23, ptr %1, align 4 - %24 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %24, double 0x400921FB54442D18) - %25 = load i64, ptr %1, align 4 - %26 = trunc i64 %25 to i1 - br i1 %26, label %__barray_mask_return.exit713, label %panic.i712 - -panic.i712: ; preds = %__barray_check_bounds.exit711.4, %__barray_check_bounds.exit711.3, %__barray_check_bounds.exit711.2, %__barray_check_bounds.exit711.1, %__barray_check_bounds.exit711 +__barray_check_bounds.exit1118: ; preds = %cond_exit_104.5 + %24 = or disjoint i64 %.pre, 1 + store i64 %24, ptr %3, align 4 + %25 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %25, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %25, double 0x400921FB54442D18) + %26 = load i64, ptr %3, align 4 + %27 = trunc i64 %26 to i1 + br i1 %27, label %__barray_mask_return.exit1120, label %panic.i1119 + +panic.i1119: ; preds = %__barray_check_bounds.exit1118.4, %__barray_check_bounds.exit1118.3, %__barray_check_bounds.exit1118.2, %__barray_check_bounds.exit1118.1, %__barray_check_bounds.exit1118 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit713: ; preds = %__barray_check_bounds.exit711 - %27 = and i64 %25, -2 - store i64 %27, ptr %1, align 4 - store i64 %24, ptr %0, align 4 - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 2 - %.not770 = icmp eq i64 %29, 0 - br i1 %.not770, label %__barray_check_bounds.exit711.1, label %panic.i709 - -__barray_check_bounds.exit711.1: ; preds = %__barray_mask_return.exit713 - %30 = or disjoint i64 %28, 2 - store i64 %30, ptr %1, align 4 - %31 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %31, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %31, double 0x400921FB54442D18) - %32 = load i64, ptr %1, align 4 - %33 = and i64 %32, 2 - %.not771 = icmp eq i64 %33, 0 - br i1 %.not771, label %panic.i712, label %__barray_mask_return.exit713.1 - -__barray_mask_return.exit713.1: ; preds = %__barray_check_bounds.exit711.1 - %34 = and i64 %32, -3 - store i64 %34, ptr %1, align 4 - store i64 %31, ptr %8, align 4 - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 4 - %.not772 = icmp eq i64 %36, 0 - br i1 %.not772, label %__barray_check_bounds.exit711.2, label %panic.i709 - -__barray_check_bounds.exit711.2: ; preds = %__barray_mask_return.exit713.1 - %37 = or disjoint i64 %35, 4 - store i64 %37, ptr %1, align 4 - %38 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %38, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %38, double 0x400921FB54442D18) - %39 = load i64, ptr %1, align 4 - %40 = and i64 %39, 4 - %.not773 = icmp eq i64 %40, 0 - br i1 %.not773, label %panic.i712, label %__barray_mask_return.exit713.2 - -__barray_mask_return.exit713.2: ; preds = %__barray_check_bounds.exit711.2 - %41 = and i64 %39, -5 - store i64 %41, ptr %1, align 4 - store i64 %38, ptr %12, align 4 - %42 = load i64, ptr %1, align 4 - %43 = and i64 %42, 8 - %.not774 = icmp eq i64 %43, 0 - br i1 %.not774, label %__barray_check_bounds.exit711.3, label %panic.i709 - -__barray_check_bounds.exit711.3: ; preds = %__barray_mask_return.exit713.2 - %44 = or disjoint i64 %42, 8 - store i64 %44, ptr %1, align 4 - %45 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %45, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %45, double 0x400921FB54442D18) - %46 = load i64, ptr %1, align 4 - %47 = and i64 %46, 8 - %.not775 = icmp eq i64 %47, 0 - br i1 %.not775, label %panic.i712, label %__barray_check_bounds.exit708.4 - -__barray_check_bounds.exit708.4: ; preds = %__barray_check_bounds.exit711.3 - %48 = and i64 %46, -9 - store i64 %48, ptr %1, align 4 - store i64 %45, ptr %16, align 4 - %49 = load i64, ptr %1, align 4 - %50 = and i64 %49, 16 - %.not776 = icmp eq i64 %50, 0 - br i1 %.not776, label %__barray_check_bounds.exit711.4, label %panic.i709 - -__barray_check_bounds.exit711.4: ; preds = %__barray_check_bounds.exit708.4 - %51 = or disjoint i64 %49, 16 - store i64 %51, ptr %1, align 4 - %52 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %52, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %52, double 0x400921FB54442D18) - %53 = load i64, ptr %1, align 4 +__barray_mask_return.exit1120: ; preds = %__barray_check_bounds.exit1118 + %28 = and i64 %26, -2 + store i64 %28, ptr %3, align 4 + store i64 %25, ptr %2, align 4 + %29 = load i64, ptr %3, align 4 + %30 = and i64 %29, 2 + %.not1182 = icmp eq i64 %30, 0 + br i1 %.not1182, label %__barray_check_bounds.exit1118.1, label %panic.i1116 + +__barray_check_bounds.exit1118.1: ; preds = %__barray_mask_return.exit1120 + %31 = or disjoint i64 %29, 2 + store i64 %31, ptr %3, align 4 + %32 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %33, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %33, double 0x400921FB54442D18) + %34 = load i64, ptr %3, align 4 + %35 = and i64 %34, 2 + %.not1183 = icmp eq i64 %35, 0 + br i1 %.not1183, label %panic.i1119, label %__barray_mask_return.exit1120.1 + +__barray_mask_return.exit1120.1: ; preds = %__barray_check_bounds.exit1118.1 + %36 = and i64 %34, -3 + store i64 %36, ptr %3, align 4 + store i64 %33, ptr %32, align 4 + %37 = load i64, ptr %3, align 4 + %38 = and i64 %37, 4 + %.not1184 = icmp eq i64 %38, 0 + br i1 %.not1184, label %__barray_check_bounds.exit1118.2, label %panic.i1116 + +__barray_check_bounds.exit1118.2: ; preds = %__barray_mask_return.exit1120.1 + %39 = or disjoint i64 %37, 4 + store i64 %39, ptr %3, align 4 + %40 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %41 = load i64, ptr %40, align 4 + tail call void @___rp(i64 %41, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %41, double 0x400921FB54442D18) + %42 = load i64, ptr %3, align 4 + %43 = and i64 %42, 4 + %.not1185 = icmp eq i64 %43, 0 + br i1 %.not1185, label %panic.i1119, label %__barray_mask_return.exit1120.2 + +__barray_mask_return.exit1120.2: ; preds = %__barray_check_bounds.exit1118.2 + %44 = and i64 %42, -5 + store i64 %44, ptr %3, align 4 + store i64 %41, ptr %40, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 8 + %.not1186 = icmp eq i64 %46, 0 + br i1 %.not1186, label %__barray_check_bounds.exit1118.3, label %panic.i1116 + +__barray_check_bounds.exit1118.3: ; preds = %__barray_mask_return.exit1120.2 + %47 = or disjoint i64 %45, 8 + store i64 %47, ptr %3, align 4 + %48 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %49 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %49, double 0x400921FB54442D18) + %50 = load i64, ptr %3, align 4 + %51 = and i64 %50, 8 + %.not1187 = icmp eq i64 %51, 0 + br i1 %.not1187, label %panic.i1119, label %__barray_check_bounds.exit1115.4 + +__barray_check_bounds.exit1115.4: ; preds = %__barray_check_bounds.exit1118.3 + %52 = and i64 %50, -9 + store i64 %52, ptr %3, align 4 + store i64 %49, ptr %48, align 4 + %53 = load i64, ptr %3, align 4 %54 = and i64 %53, 16 - %.not777 = icmp eq i64 %54, 0 - br i1 %.not777, label %panic.i712, label %__barray_mask_return.exit713.4 - -__barray_mask_return.exit713.4: ; preds = %__barray_check_bounds.exit711.4 - %55 = and i64 %53, -17 - store i64 %55, ptr %1, align 4 - store i64 %52, ptr %20, align 4 - %shot = tail call i64 @get_current_shot() - %shot109 = tail call i64 @get_current_shot() - %56 = tail call ptr @heap_alloc(i64 40) - %57 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %57, align 1 - %58 = load i64, ptr %1, align 4 - %59 = trunc i64 %58 to i1 - br i1 %59, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - -mask_block_err.i: ; preds = %cond_exit_598.4 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + %.not1188 = icmp eq i64 %54, 0 + br i1 %.not1188, label %__barray_check_bounds.exit1118.4, label %panic.i1116 + +__barray_check_bounds.exit1118.4: ; preds = %__barray_check_bounds.exit1115.4 + %55 = or disjoint i64 %53, 16 + store i64 %55, ptr %3, align 4 + %56 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %57 = load i64, ptr %56, align 4 + tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %57, double 0x400921FB54442D18) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 16 + %.not1189 = icmp eq i64 %59, 0 + br i1 %.not1189, label %panic.i1119, label %__barray_mask_return.exit1120.4 + +__barray_mask_return.exit1120.4: ; preds = %__barray_check_bounds.exit1118.4 + %60 = and i64 %58, -17 + store i64 %60, ptr %3, align 4 + store i64 %57, ptr %56, align 4 + %61 = load i64, ptr %3, align 4 + %62 = trunc i64 %61 to i1 + br i1 %62, label %panic.i1127, label %.thread + +panic.i1123: ; preds = %__barray_check_bounds.exit1122.4, %.thread.3, %.thread.2, %.thread.1, %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit719: ; preds = %__barray_mask_return.exit739 - %60 = or disjoint i64 %161, 1 - store i64 %60, ptr %57, align 4 - %61 = load i64, ptr %56, align 4 - tail call void @___dec_future_refcount(i64 %61) - br label %cond_exit_598 - -cond_exit_598: ; preds = %__barray_mask_borrow.exit719, %__barray_mask_return.exit739 - %62 = load i64, ptr %57, align 4 - %63 = and i64 %62, 2 - %.not780 = icmp eq i64 %63, 0 - br i1 %.not780, label %__barray_mask_borrow.exit719.1, label %cond_exit_598.1 - -__barray_mask_borrow.exit719.1: ; preds = %cond_exit_598 - %64 = or disjoint i64 %62, 2 - store i64 %64, ptr %57, align 4 - %65 = getelementptr inbounds nuw i8, ptr %56, i64 8 - %66 = load i64, ptr %65, align 4 - tail call void @___dec_future_refcount(i64 %66) - br label %cond_exit_598.1 - -cond_exit_598.1: ; preds = %__barray_mask_borrow.exit719.1, %cond_exit_598 - %67 = load i64, ptr %57, align 4 - %68 = and i64 %67, 4 - %.not781 = icmp eq i64 %68, 0 - br i1 %.not781, label %__barray_mask_borrow.exit719.2, label %cond_exit_598.2 - -__barray_mask_borrow.exit719.2: ; preds = %cond_exit_598.1 - %69 = or disjoint i64 %67, 4 - store i64 %69, ptr %57, align 4 - %70 = getelementptr inbounds nuw i8, ptr %56, i64 16 - %71 = load i64, ptr %70, align 4 - tail call void @___dec_future_refcount(i64 %71) - br label %cond_exit_598.2 - -cond_exit_598.2: ; preds = %__barray_mask_borrow.exit719.2, %cond_exit_598.1 - %72 = load i64, ptr %57, align 4 - %73 = and i64 %72, 8 - %.not782 = icmp eq i64 %73, 0 - br i1 %.not782, label %__barray_mask_borrow.exit719.3, label %cond_exit_598.3 - -__barray_mask_borrow.exit719.3: ; preds = %cond_exit_598.2 - %74 = or disjoint i64 %72, 8 - store i64 %74, ptr %57, align 4 - %75 = getelementptr inbounds nuw i8, ptr %56, i64 24 - %76 = load i64, ptr %75, align 4 - tail call void @___dec_future_refcount(i64 %76) - br label %cond_exit_598.3 - -cond_exit_598.3: ; preds = %__barray_mask_borrow.exit719.3, %cond_exit_598.2 - %77 = load i64, ptr %57, align 4 - %78 = and i64 %77, 16 - %.not783 = icmp eq i64 %78, 0 - br i1 %.not783, label %__barray_mask_borrow.exit719.4, label %cond_exit_598.4 - -__barray_mask_borrow.exit719.4: ; preds = %cond_exit_598.3 - %79 = or disjoint i64 %77, 16 - store i64 %79, ptr %57, align 4 - %80 = getelementptr inbounds nuw i8, ptr %56, i64 32 - %81 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %81) - br label %cond_exit_598.4 - -cond_exit_598.4: ; preds = %__barray_mask_borrow.exit719.4, %cond_exit_598.3 - %82 = load i64, ptr %57, align 4 - %83 = or i64 %82, -32 - store i64 %83, ptr %57, align 4 - %84 = icmp eq i64 %83, -1 - br i1 %84, label %loop_out309, label %mask_block_err.i - -loop_out309: ; preds = %cond_exit_598.4 - tail call void @heap_free(ptr nonnull %56) - tail call void @heap_free(ptr nonnull %57) - %read_bool = tail call i1 @___read_future_bool(i64 %129) - tail call void @___dec_future_refcount(i64 %129) - tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) - %read_bool378 = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool378) - %read_bool393 = tail call i1 @___read_future_bool(i64 %143) - tail call void @___dec_future_refcount(i64 %143) - tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool393) - %read_bool408 = tail call i1 @___read_future_bool(i64 %150) - tail call void @___dec_future_refcount(i64 %150) - tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool408) - %read_bool423 = tail call i1 @___read_future_bool(i64 %157) - tail call void @___dec_future_refcount(i64 %157) - tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool423) - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot109) - tail call void @random_seed(i64 %shot) - %rint = tail call i32 @random_int() - %rfloat = tail call double @random_float() - %85 = sext i32 %rint to i64 - tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %85) - tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) - ret void - -"__hugr__.guppylang.std.quantum.measure_array$5.314.exit": ; preds = %loop_body.4.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %86 = load i64, ptr %57, align 4 - %87 = trunc i64 %86 to i1 - br i1 %87, label %panic.i720, label %__barray_mask_borrow.exit721 +loop_out318: ; preds = %cond_exit_298.4 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %63 = load i64, ptr %1, align 4 + %64 = trunc i64 %63 to i1 + br i1 %64, label %panic.i1129, label %__barray_mask_borrow.exit1130 -mask_block_err.i.i.i: ; preds = %loop_body.4.i +mask_block_err.i: ; preds = %cond_exit_298.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.4.i, %loop_body.2.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit713.4 +panic.i1127: ; preds = %__barray_check_bounds.exit1126.4, %cond_exit_298.2, %cond_exit_298.1, %cond_exit_298, %__barray_mask_return.exit1120.4 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i": ; preds = %__barray_mask_return.exit713.4 - %88 = or disjoint i64 %58, 1 - store i64 %88, ptr %1, align 4 - %89 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %89) +.thread: ; preds = %__barray_mask_return.exit1120.4 + %65 = or disjoint i64 %61, 1 + store i64 %65, ptr %3, align 4 + %66 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %66) + tail call void @___qfree(i64 %66) + %67 = load i64, ptr %1, align 4 + %68 = trunc i64 %67 to i1 + br i1 %68, label %cond_exit_298, label %panic.i1123 + +cond_exit_298: ; preds = %.thread + %69 = and i64 %67, -2 + store i64 %69, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not1190 = icmp eq i64 %71, 0 + br i1 %.not1190, label %.thread.1, label %panic.i1127 + +.thread.1: ; preds = %cond_exit_298 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = load i64, ptr %32, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %73) + tail call void @___qfree(i64 %73) + %74 = load i64, ptr %1, align 4 + %75 = and i64 %74, 2 + %.not1191 = icmp eq i64 %75, 0 + br i1 %.not1191, label %panic.i1123, label %cond_exit_298.1 + +cond_exit_298.1: ; preds = %.thread.1 + %76 = and i64 %74, -3 + store i64 %76, ptr %1, align 4 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %77, align 4 + %78 = load i64, ptr %3, align 4 + %79 = and i64 %78, 4 + %.not1192 = icmp eq i64 %79, 0 + br i1 %.not1192, label %.thread.2, label %panic.i1127 + +.thread.2: ; preds = %cond_exit_298.1 + %80 = or disjoint i64 %78, 4 + store i64 %80, ptr %3, align 4 + %81 = load i64, ptr %40, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %81) + tail call void @___qfree(i64 %81) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 4 + %.not1193 = icmp eq i64 %83, 0 + br i1 %.not1193, label %panic.i1123, label %cond_exit_298.2 + +cond_exit_298.2: ; preds = %.thread.2 + %84 = and i64 %82, -5 + store i64 %84, ptr %1, align 4 + %85 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %85, align 4 + %86 = load i64, ptr %3, align 4 + %87 = and i64 %86, 8 + %.not1194 = icmp eq i64 %87, 0 + br i1 %.not1194, label %.thread.3, label %panic.i1127 + +.thread.3: ; preds = %cond_exit_298.2 + %88 = or disjoint i64 %86, 8 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %48, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %89) tail call void @___qfree(i64 %89) - %90 = load i64, ptr %57, align 4 - %91 = trunc i64 %90 to i1 - br i1 %91, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.4.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.i" - %92 = and i64 %90, -2 - store i64 %92, ptr %57, align 4 - store i64 %lazy_measure.i, ptr %56, align 4 - %93 = load i64, ptr %1, align 4 - %94 = and i64 %93, 2 - %.not = icmp eq i64 %94, 0 - br i1 %.not, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i": ; preds = %loop_body.i - %95 = or disjoint i64 %93, 2 - store i64 %95, ptr %1, align 4 - %96 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %96) - tail call void @___qfree(i64 %96) - %97 = load i64, ptr %57, align 4 - %98 = and i64 %97, 2 - %.not.i = icmp eq i64 %98, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.1.i" - %99 = and i64 %97, -3 - store i64 %99, ptr %57, align 4 - %100 = getelementptr inbounds nuw i8, ptr %56, i64 8 - store i64 %lazy_measure.1.i, ptr %100, align 4 - %101 = load i64, ptr %1, align 4 - %102 = and i64 %101, 4 - %.not752 = icmp eq i64 %102, 0 - br i1 %.not752, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i": ; preds = %loop_body.1.i - %103 = or disjoint i64 %101, 4 - store i64 %103, ptr %1, align 4 - %104 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %104) - tail call void @___qfree(i64 %104) - %105 = load i64, ptr %57, align 4 - %106 = and i64 %105, 4 - %.not182.i = icmp eq i64 %106, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.2.i" - %107 = and i64 %105, -5 - store i64 %107, ptr %57, align 4 - %108 = getelementptr inbounds nuw i8, ptr %56, i64 16 - store i64 %lazy_measure.2.i, ptr %108, align 4 - %109 = load i64, ptr %1, align 4 - %110 = and i64 %109, 8 - %.not753 = icmp eq i64 %110, 0 - br i1 %.not753, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i": ; preds = %loop_body.2.i - %111 = or disjoint i64 %109, 8 - store i64 %111, ptr %1, align 4 - %112 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %57, align 4 - %114 = and i64 %113, 8 - %.not183.i = icmp eq i64 %114, 0 - br i1 %.not183.i, label %panic.i.i, label %__barray_check_bounds.exit.i.4.i - -__barray_check_bounds.exit.i.4.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&5.387.exit.thread.3.i" - %115 = and i64 %113, -9 - store i64 %115, ptr %57, align 4 - %116 = getelementptr inbounds nuw i8, ptr %56, i64 24 - store i64 %lazy_measure.3.i, ptr %116, align 4 - %117 = load i64, ptr %1, align 4 - %118 = and i64 %117, 16 - %.not754 = icmp eq i64 %118, 0 - br i1 %.not754, label %__barray_check_bounds.exit.4.i, label %panic.i.i.i - -__barray_check_bounds.exit.4.i: ; preds = %__barray_check_bounds.exit.i.4.i - %119 = or disjoint i64 %117, 16 - store i64 %119, ptr %1, align 4 - %120 = load i64, ptr %20, align 4 - %lazy_measure.4.i = tail call i64 @___lazy_measure(i64 %120) - tail call void @___qfree(i64 %120) - %121 = load i64, ptr %57, align 4 - %122 = and i64 %121, 16 - %.not184.i = icmp eq i64 %122, 0 - br i1 %.not184.i, label %panic.i.i, label %loop_body.4.i - -loop_body.4.i: ; preds = %__barray_check_bounds.exit.4.i - %123 = and i64 %121, -17 - store i64 %123, ptr %57, align 4 - %124 = getelementptr inbounds nuw i8, ptr %56, i64 32 - store i64 %lazy_measure.4.i, ptr %124, align 4 - %125 = load i64, ptr %1, align 4 - %126 = or i64 %125, -32 - store i64 %126, ptr %1, align 4 - %127 = icmp eq i64 %126, -1 - br i1 %127, label %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit", label %mask_block_err.i.i.i - -panic.i720: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" + %90 = load i64, ptr %1, align 4 + %91 = and i64 %90, 8 + %.not1195 = icmp eq i64 %91, 0 + br i1 %.not1195, label %panic.i1123, label %__barray_check_bounds.exit1126.4 + +__barray_check_bounds.exit1126.4: ; preds = %.thread.3 + %92 = and i64 %90, -9 + store i64 %92, ptr %1, align 4 + %93 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i64 %lazy_measure.3, ptr %93, align 4 + %94 = load i64, ptr %3, align 4 + %95 = and i64 %94, 16 + %.not1196 = icmp eq i64 %95, 0 + br i1 %.not1196, label %__barray_check_bounds.exit1122.4, label %panic.i1127 + +__barray_check_bounds.exit1122.4: ; preds = %__barray_check_bounds.exit1126.4 + %96 = or disjoint i64 %94, 16 + store i64 %96, ptr %3, align 4 + %97 = load i64, ptr %56, align 4 + %lazy_measure.4 = tail call i64 @___lazy_measure(i64 %97) + tail call void @___qfree(i64 %97) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 16 + %.not1197 = icmp eq i64 %99, 0 + br i1 %.not1197, label %panic.i1123, label %cond_exit_298.4 + +cond_exit_298.4: ; preds = %__barray_check_bounds.exit1122.4 + %100 = and i64 %98, -17 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 32 + store i64 %lazy_measure.4, ptr %101, align 4 + %102 = load i64, ptr %3, align 4 + %103 = or i64 %102, -32 + store i64 %103, ptr %3, align 4 + %104 = icmp eq i64 %103, -1 + br i1 %104, label %loop_out318, label %mask_block_err.i + +panic.i1129: ; preds = %loop_out318 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit721: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$5.314.exit" - %128 = or disjoint i64 %86, 1 - store i64 %128, ptr %57, align 4 - %129 = load i64, ptr %56, align 4 - tail call void @___inc_future_refcount(i64 %129) - %130 = load i64, ptr %57, align 4 - %131 = trunc i64 %130 to i1 - br i1 %131, label %__barray_mask_return.exit723, label %panic.i722 +__barray_mask_borrow.exit1130: ; preds = %loop_out318 + %105 = or disjoint i64 %63, 1 + store i64 %105, ptr %1, align 4 + %106 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %1, align 4 + %108 = trunc i64 %107 to i1 + br i1 %108, label %__barray_mask_return.exit1132, label %panic.i1131 -panic.i722: ; preds = %__barray_mask_borrow.exit721 +panic.i1131: ; preds = %__barray_mask_borrow.exit1130 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit723: ; preds = %__barray_mask_borrow.exit721 - %132 = and i64 %130, -2 - store i64 %132, ptr %57, align 4 - store i64 %129, ptr %56, align 4 - %133 = load i64, ptr %57, align 4 - %134 = and i64 %133, 2 - %.not755 = icmp eq i64 %134, 0 - br i1 %.not755, label %__barray_mask_borrow.exit725, label %panic.i724 +__barray_mask_return.exit1132: ; preds = %__barray_mask_borrow.exit1130 + %109 = and i64 %107, -2 + store i64 %109, ptr %1, align 4 + store i64 %106, ptr %0, align 4 + %110 = load i64, ptr %1, align 4 + %111 = and i64 %110, 2 + %.not = icmp eq i64 %111, 0 + br i1 %.not, label %__barray_mask_borrow.exit1134, label %panic.i1133 -panic.i724: ; preds = %__barray_mask_return.exit723 +panic.i1133: ; preds = %__barray_mask_return.exit1132 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit725: ; preds = %__barray_mask_return.exit723 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %57, align 4 - %136 = load i64, ptr %100, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %57, align 4 - %138 = and i64 %137, 2 - %.not756 = icmp eq i64 %138, 0 - br i1 %.not756, label %panic.i726, label %__barray_mask_return.exit727 - -panic.i726: ; preds = %__barray_mask_borrow.exit725 +__barray_mask_borrow.exit1134: ; preds = %__barray_mask_return.exit1132 + %112 = or disjoint i64 %110, 2 + store i64 %112, ptr %1, align 4 + %113 = load i64, ptr %77, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %1, align 4 + %115 = and i64 %114, 2 + %.not1168 = icmp eq i64 %115, 0 + br i1 %.not1168, label %panic.i1135, label %__barray_mask_return.exit1136 + +panic.i1135: ; preds = %__barray_mask_borrow.exit1134 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit727: ; preds = %__barray_mask_borrow.exit725 - %139 = and i64 %137, -3 - store i64 %139, ptr %57, align 4 - store i64 %136, ptr %100, align 4 - %140 = load i64, ptr %57, align 4 - %141 = and i64 %140, 4 - %.not757 = icmp eq i64 %141, 0 - br i1 %.not757, label %__barray_mask_borrow.exit729, label %panic.i728 +__barray_mask_return.exit1136: ; preds = %__barray_mask_borrow.exit1134 + %116 = and i64 %114, -3 + store i64 %116, ptr %1, align 4 + store i64 %113, ptr %77, align 4 + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 4 + %.not1169 = icmp eq i64 %118, 0 + br i1 %.not1169, label %__barray_mask_borrow.exit1138, label %panic.i1137 -panic.i728: ; preds = %__barray_mask_return.exit727 +panic.i1137: ; preds = %__barray_mask_return.exit1136 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit729: ; preds = %__barray_mask_return.exit727 - %142 = or disjoint i64 %140, 4 - store i64 %142, ptr %57, align 4 - %143 = load i64, ptr %108, align 4 - tail call void @___inc_future_refcount(i64 %143) - %144 = load i64, ptr %57, align 4 - %145 = and i64 %144, 4 - %.not758 = icmp eq i64 %145, 0 - br i1 %.not758, label %panic.i730, label %__barray_mask_return.exit731 - -panic.i730: ; preds = %__barray_mask_borrow.exit729 +__barray_mask_borrow.exit1138: ; preds = %__barray_mask_return.exit1136 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %1, align 4 + %120 = load i64, ptr %85, align 4 + tail call void @___inc_future_refcount(i64 %120) + %121 = load i64, ptr %1, align 4 + %122 = and i64 %121, 4 + %.not1170 = icmp eq i64 %122, 0 + br i1 %.not1170, label %panic.i1139, label %__barray_mask_return.exit1140 + +panic.i1139: ; preds = %__barray_mask_borrow.exit1138 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit731: ; preds = %__barray_mask_borrow.exit729 - %146 = and i64 %144, -5 - store i64 %146, ptr %57, align 4 - store i64 %143, ptr %108, align 4 - %147 = load i64, ptr %57, align 4 - %148 = and i64 %147, 8 - %.not759 = icmp eq i64 %148, 0 - br i1 %.not759, label %__barray_mask_borrow.exit733, label %panic.i732 +__barray_mask_return.exit1140: ; preds = %__barray_mask_borrow.exit1138 + %123 = and i64 %121, -5 + store i64 %123, ptr %1, align 4 + store i64 %120, ptr %85, align 4 + %124 = load i64, ptr %1, align 4 + %125 = and i64 %124, 8 + %.not1171 = icmp eq i64 %125, 0 + br i1 %.not1171, label %__barray_mask_borrow.exit1142, label %panic.i1141 -panic.i732: ; preds = %__barray_mask_return.exit731 +panic.i1141: ; preds = %__barray_mask_return.exit1140 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit733: ; preds = %__barray_mask_return.exit731 - %149 = or disjoint i64 %147, 8 - store i64 %149, ptr %57, align 4 - %150 = load i64, ptr %116, align 4 - tail call void @___inc_future_refcount(i64 %150) - %151 = load i64, ptr %57, align 4 - %152 = and i64 %151, 8 - %.not760 = icmp eq i64 %152, 0 - br i1 %.not760, label %panic.i734, label %__barray_mask_return.exit735 - -panic.i734: ; preds = %__barray_mask_borrow.exit733 +__barray_mask_borrow.exit1142: ; preds = %__barray_mask_return.exit1140 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %1, align 4 + %127 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %127) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 8 + %.not1172 = icmp eq i64 %129, 0 + br i1 %.not1172, label %panic.i1143, label %__barray_mask_return.exit1144 + +panic.i1143: ; preds = %__barray_mask_borrow.exit1142 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit735: ; preds = %__barray_mask_borrow.exit733 - %153 = and i64 %151, -9 - store i64 %153, ptr %57, align 4 - store i64 %150, ptr %116, align 4 - %154 = load i64, ptr %57, align 4 - %155 = and i64 %154, 16 - %.not761 = icmp eq i64 %155, 0 - br i1 %.not761, label %__barray_mask_borrow.exit737, label %panic.i736 +__barray_mask_return.exit1144: ; preds = %__barray_mask_borrow.exit1142 + %130 = and i64 %128, -9 + store i64 %130, ptr %1, align 4 + store i64 %127, ptr %93, align 4 + %131 = load i64, ptr %1, align 4 + %132 = and i64 %131, 16 + %.not1173 = icmp eq i64 %132, 0 + br i1 %.not1173, label %__barray_mask_borrow.exit1146, label %panic.i1145 -panic.i736: ; preds = %__barray_mask_return.exit735 +panic.i1145: ; preds = %__barray_mask_return.exit1144 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit737: ; preds = %__barray_mask_return.exit735 - %156 = or disjoint i64 %154, 16 - store i64 %156, ptr %57, align 4 - %157 = load i64, ptr %124, align 4 - tail call void @___inc_future_refcount(i64 %157) - %158 = load i64, ptr %57, align 4 - %159 = and i64 %158, 16 - %.not762 = icmp eq i64 %159, 0 - br i1 %.not762, label %panic.i738, label %__barray_mask_return.exit739 - -panic.i738: ; preds = %__barray_mask_borrow.exit737 +__barray_mask_borrow.exit1146: ; preds = %__barray_mask_return.exit1144 + %133 = or disjoint i64 %131, 16 + store i64 %133, ptr %1, align 4 + %134 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %134) + %135 = load i64, ptr %1, align 4 + %136 = and i64 %135, 16 + %.not1174 = icmp eq i64 %136, 0 + br i1 %.not1174, label %panic.i1147, label %__barray_mask_return.exit1148 + +panic.i1147: ; preds = %__barray_mask_borrow.exit1146 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit739: ; preds = %__barray_mask_borrow.exit737 - %160 = and i64 %158, -17 - store i64 %160, ptr %57, align 4 - store i64 %157, ptr %124, align 4 - %161 = load i64, ptr %57, align 4 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_598, label %__barray_mask_borrow.exit719 +__barray_mask_return.exit1148: ; preds = %__barray_mask_borrow.exit1146 + %137 = and i64 %135, -17 + store i64 %137, ptr %1, align 4 + store i64 %134, ptr %101, align 4 + %138 = load i64, ptr %1, align 4 + %139 = trunc i64 %138 to i1 + br i1 %139, label %cond_exit_558, label %__barray_mask_borrow.exit1160 + +mask_block_err.i1152: ; preds = %cond_exit_558.4 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1160: ; preds = %__barray_mask_return.exit1148 + %140 = or disjoint i64 %138, 1 + store i64 %140, ptr %1, align 4 + %141 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_558 + +cond_exit_558: ; preds = %__barray_mask_borrow.exit1160, %__barray_mask_return.exit1148 + %142 = load i64, ptr %1, align 4 + %143 = and i64 %142, 2 + %.not1200 = icmp eq i64 %143, 0 + br i1 %.not1200, label %__barray_mask_borrow.exit1160.1, label %cond_exit_558.1 + +__barray_mask_borrow.exit1160.1: ; preds = %cond_exit_558 + %144 = or disjoint i64 %142, 2 + store i64 %144, ptr %1, align 4 + %145 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_558.1 + +cond_exit_558.1: ; preds = %__barray_mask_borrow.exit1160.1, %cond_exit_558 + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 4 + %.not1201 = icmp eq i64 %148, 0 + br i1 %.not1201, label %__barray_mask_borrow.exit1160.2, label %cond_exit_558.2 + +__barray_mask_borrow.exit1160.2: ; preds = %cond_exit_558.1 + %149 = or disjoint i64 %147, 4 + store i64 %149, ptr %1, align 4 + %150 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_558.2 + +cond_exit_558.2: ; preds = %__barray_mask_borrow.exit1160.2, %cond_exit_558.1 + %152 = load i64, ptr %1, align 4 + %153 = and i64 %152, 8 + %.not1202 = icmp eq i64 %153, 0 + br i1 %.not1202, label %__barray_mask_borrow.exit1160.3, label %cond_exit_558.3 + +__barray_mask_borrow.exit1160.3: ; preds = %cond_exit_558.2 + %154 = or disjoint i64 %152, 8 + store i64 %154, ptr %1, align 4 + %155 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_558.3 + +cond_exit_558.3: ; preds = %__barray_mask_borrow.exit1160.3, %cond_exit_558.2 + %157 = load i64, ptr %1, align 4 + %158 = and i64 %157, 16 + %.not1203 = icmp eq i64 %158, 0 + br i1 %.not1203, label %__barray_mask_borrow.exit1160.4, label %cond_exit_558.4 + +__barray_mask_borrow.exit1160.4: ; preds = %cond_exit_558.3 + %159 = or disjoint i64 %157, 16 + store i64 %159, ptr %1, align 4 + %160 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_558.4 + +cond_exit_558.4: ; preds = %__barray_mask_borrow.exit1160.4, %cond_exit_558.3 + %162 = load i64, ptr %1, align 4 + %163 = or i64 %162, -32 + store i64 %163, ptr %1, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out620, label %mask_block_err.i1152 + +loop_out620: ; preds = %cond_exit_558.4 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + tail call void @print_bool(ptr nonnull @res_a.A4A74DAF.0, i64 11, i1 %read_bool) + %read_bool690 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + tail call void @print_bool(ptr nonnull @res_b.3BD50C23.0, i64 11, i1 %read_bool690) + %read_bool705 = tail call i1 @___read_future_bool(i64 %120) + tail call void @___dec_future_refcount(i64 %120) + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool705) + %read_bool720 = tail call i1 @___read_future_bool(i64 %127) + tail call void @___dec_future_refcount(i64 %127) + tail call void @print_bool(ptr nonnull @res_d.00B84DC7.0, i64 11, i1 %read_bool720) + %read_bool735 = tail call i1 @___read_future_bool(i64 %134) + tail call void @___dec_future_refcount(i64 %134) + tail call void @print_bool(ptr nonnull @res_e.B9A29CAF.0, i64 11, i1 %read_bool735) + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot2) + %rint = tail call i32 @random_int() + %rfloat = tail call double @random_float() + %165 = sext i32 %rint to i64 + tail call void @print_int(ptr nonnull @res_random_int.805B8DD0.0, i64 19, i64 %165) + tail call void @print_float(ptr nonnull @res_random_flo.4EFA2734.0, i64 23, double %rfloat) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr +declare i64 @get_current_shot() local_unnamed_addr + +declare void @random_seed(i64) local_unnamed_addr + ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare i64 @get_current_shot() local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr @@ -605,12 +615,6 @@ declare double @random_float() local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - -declare void @random_seed(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rz(i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-apple-darwin.ll index 9d2d8552..584e1550 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-apple-darwin.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_helios_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_helios_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_helios_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_helios_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rxy(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_helios_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_helios_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rxy(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_helios_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rxy(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_helios_qalloc.121.exit, %__hugr__.__tk2_helios_qalloc.93.exit, %__hugr__.__tk2_helios_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit51, %__hugr__.__tk2_helios_qalloc.52.exit47, %__hugr__.__tk2_helios_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-unknown-linux-gnu.ll index 19e99c8b..11c533b6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-aarch64-unknown-linux-gnu.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_helios_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_helios_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_helios_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_helios_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rxy(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_helios_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_helios_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rxy(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_helios_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rxy(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_helios_qalloc.121.exit, %__hugr__.__tk2_helios_qalloc.93.exit, %__hugr__.__tk2_helios_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit51, %__hugr__.__tk2_helios_qalloc.52.exit47, %__hugr__.__tk2_helios_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-apple-darwin.ll index e6f37405..f4734a31 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-apple-darwin.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_helios_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_helios_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_helios_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_helios_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rxy(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_helios_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_helios_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rxy(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_helios_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rxy(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_helios_qalloc.121.exit, %__hugr__.__tk2_helios_qalloc.93.exit, %__hugr__.__tk2_helios_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit51, %__hugr__.__tk2_helios_qalloc.52.exit47, %__hugr__.__tk2_helios_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-unknown-linux-gnu.ll index 4085a111..9e46ed57 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-unknown-linux-gnu.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_helios_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_helios_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_helios_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_helios_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rxy(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_helios_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_helios_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rxy(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_helios_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rxy(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_helios_qalloc.121.exit, %__hugr__.__tk2_helios_qalloc.93.exit, %__hugr__.__tk2_helios_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit51, %__hugr__.__tk2_helios_qalloc.52.exit47, %__hugr__.__tk2_helios_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-windows-gnu.ll index 64d61375..cc74b479 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-helios-x86_64-windows-gnu.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_helios_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_helios_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_helios_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_helios_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_helios_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rxy(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_helios_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_helios_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_helios_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rxy(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_helios_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rxy(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_helios_qalloc.121.exit, %__hugr__.__tk2_helios_qalloc.93.exit, %__hugr__.__tk2_helios_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_helios_qalloc.52.exit51, %__hugr__.__tk2_helios_qalloc.52.exit47, %__hugr__.__tk2_helios_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-apple-darwin.ll index 01a2e1e1..ef130f09 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-apple-darwin.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_sol_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_sol_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_sol_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_sol_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_sol_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_sol_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rp(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_sol_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rp(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_sol_qalloc.121.exit, %__hugr__.__tk2_sol_qalloc.93.exit, %__hugr__.__tk2_sol_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit51, %__hugr__.__tk2_sol_qalloc.52.exit47, %__hugr__.__tk2_sol_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-unknown-linux-gnu.ll index c86afe6d..86c1ce3d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-aarch64-unknown-linux-gnu.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_sol_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_sol_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_sol_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_sol_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_sol_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_sol_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rp(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_sol_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rp(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_sol_qalloc.121.exit, %__hugr__.__tk2_sol_qalloc.93.exit, %__hugr__.__tk2_sol_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit51, %__hugr__.__tk2_sol_qalloc.52.exit47, %__hugr__.__tk2_sol_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-apple-darwin.ll index 6901c275..f877fc95 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-apple-darwin.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_sol_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_sol_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_sol_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_sol_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_sol_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_sol_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rp(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_sol_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rp(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_sol_qalloc.121.exit, %__hugr__.__tk2_sol_qalloc.93.exit, %__hugr__.__tk2_sol_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit51, %__hugr__.__tk2_sol_qalloc.52.exit47, %__hugr__.__tk2_sol_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-unknown-linux-gnu.ll index e183c5d4..1abcb19c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-unknown-linux-gnu.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_sol_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_sol_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_sol_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_sol_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_sol_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_sol_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rp(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_sol_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rp(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_sol_qalloc.121.exit, %__hugr__.__tk2_sol_qalloc.93.exit, %__hugr__.__tk2_sol_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit51, %__hugr__.__tk2_sol_qalloc.52.exit47, %__hugr__.__tk2_sol_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-windows-gnu.ll index e9d5f66a..6dd8e9ec 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_circuit_output/circuit_output-sol-x86_64-windows-gnu.ll @@ -12,13 +12,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i, label %cond_56_case_0.i, label %__hugr__.__tk2_sol_qalloc.52.exit -cond_72_case_0.i: ; preds = %alloca_block +cond_56_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.52.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -29,16 +29,16 @@ __hugr__.__tk2_sol_qalloc.68.exit: ; preds = %alloca_block tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) br i1 %read_bool, label %0, label %2 -0: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit %qalloc.i44 = tail call i64 @___qalloc() %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 - br i1 %not_max.not.not.i45, label %cond_97_case_0.i, label %__hugr__.__tk2_sol_qalloc.93.exit + br i1 %not_max.not.not.i45, label %cond_56_case_0.i46, label %__hugr__.__tk2_sol_qalloc.52.exit47 -cond_97_case_0.i: ; preds = %0 +cond_56_case_0.i46: ; preds = %0 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 +__hugr__.__tk2_sol_qalloc.52.exit47: ; preds = %0 tail call void @___reset(i64 %qalloc.i44) tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i44, double 0x400921FB54442D18) @@ -47,32 +47,32 @@ __hugr__.__tk2_sol_qalloc.93.exit: ; preds = %0 tail call void @___inc_future_refcount(i64 %lazy_measure10) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure10) + %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure10) tail call void @___dec_future_refcount(i64 %lazy_measure10) - br i1 %read_bool.i, label %1, label %2 + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool19) + br i1 %read_bool16, label %1, label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.93.exit - %qalloc.i46 = tail call i64 @___qalloc() - %not_max.not.not.i47 = icmp eq i64 %qalloc.i46, -1 - br i1 %not_max.not.not.i47, label %cond_125_case_0.i, label %__hugr__.__tk2_sol_qalloc.121.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit47 + %qalloc.i48 = tail call i64 @___qalloc() + %not_max.not.not.i49 = icmp eq i64 %qalloc.i48, -1 + br i1 %not_max.not.not.i49, label %cond_56_case_0.i50, label %__hugr__.__tk2_sol_qalloc.52.exit51 -cond_125_case_0.i: ; preds = %1 +cond_56_case_0.i50: ; preds = %1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.121.exit: ; preds = %1 - tail call void @___reset(i64 %qalloc.i46) - tail call void @___rp(i64 %qalloc.i46, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i46, double 0x400921FB54442D18) - %lazy_measure28 = tail call i64 @___lazy_measure(i64 %qalloc.i46) - tail call void @___qfree(i64 %qalloc.i46) - %read_bool30 = tail call i1 @___read_future_bool(i64 %lazy_measure28) - tail call void @___dec_future_refcount(i64 %lazy_measure28) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool30) +__hugr__.__tk2_sol_qalloc.52.exit51: ; preds = %1 + tail call void @___reset(i64 %qalloc.i48) + tail call void @___rp(i64 %qalloc.i48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i48, double 0x400921FB54442D18) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i48) + tail call void @___qfree(i64 %qalloc.i48) + %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) + tail call void @___dec_future_refcount(i64 %lazy_measure30) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool32) br label %2 -2: ; preds = %__hugr__.__tk2_sol_qalloc.121.exit, %__hugr__.__tk2_sol_qalloc.93.exit, %__hugr__.__tk2_sol_qalloc.68.exit +2: ; preds = %__hugr__.__tk2_sol_qalloc.52.exit51, %__hugr__.__tk2_sol_qalloc.52.exit47, %__hugr__.__tk2_sol_qalloc.52.exit ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-apple-darwin.ll index 0f7bd2f6..7844fc7d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-unknown-linux-gnu.ll index 60d2434e..d8e65013 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-aarch64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-apple-darwin.ll index 5ce72eef..a1d32e84 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-unknown-linux-gnu.ll index 3cf0bfbf..503e50d9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-windows-gnu.ll index c0db9f2e..0040ad68 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-helios-x86_64-windows-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-apple-darwin.ll index b22ed02d..524c83da 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-unknown-linux-gnu.ll index 27e27e26..d9a1c67d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-aarch64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-apple-darwin.ll index feaf17ac..ca57cada 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-unknown-linux-gnu.ll index 51120740..0d7e519d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-windows-gnu.ll index c938d004..0dc9ebe7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_corrupted_plugin/broken_plugin-sol-x86_64-windows-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-apple-darwin.ll index 5967356f..b518d835 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-apple-darwin.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_helios_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_helios_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_helios_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_helios_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0x400921FB54442D18) +__hugr__.__tk2_helios_qalloc.60.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x400921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rxy(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_146_case_0.i, label %__hugr__.__tk2_helios_qalloc.142.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_helios_qalloc.60.exit260 -cond_146_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.142.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_160_case_0.i, label %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_helios_qalloc.60.exit264 -cond_160_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.156.exit: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit - call void @___reset(i64 %qalloc.i247) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit264: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_211_case_0.i, label %__hugr__.__tk2_helios_qalloc.207.exit - -cond_211_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_helios_qalloc.207.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_225_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_helios_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit - call void @___reset(i64 %qalloc.i257) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_helios_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_helios_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +__hugr__.__tk2_helios_qalloc.60.exit282: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_276_case_0.i, label %__hugr__.__tk2_helios_qalloc.272.exit - -cond_276_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_helios_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.272.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_290_case_0.i, label %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_helios_qalloc.60.exit300 -cond_290_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.286.exit: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit - call void @___reset(i64 %qalloc.i267) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit300: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-unknown-linux-gnu.ll index 120584f4..c2909c46 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-aarch64-unknown-linux-gnu.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_helios_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_helios_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_helios_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_helios_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0x400921FB54442D18) +__hugr__.__tk2_helios_qalloc.60.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x400921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rxy(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_146_case_0.i, label %__hugr__.__tk2_helios_qalloc.142.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_helios_qalloc.60.exit260 -cond_146_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.142.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_160_case_0.i, label %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_helios_qalloc.60.exit264 -cond_160_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.156.exit: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit - call void @___reset(i64 %qalloc.i247) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit264: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_211_case_0.i, label %__hugr__.__tk2_helios_qalloc.207.exit - -cond_211_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_helios_qalloc.207.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_225_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_helios_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit - call void @___reset(i64 %qalloc.i257) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_helios_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_helios_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +__hugr__.__tk2_helios_qalloc.60.exit282: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_276_case_0.i, label %__hugr__.__tk2_helios_qalloc.272.exit - -cond_276_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_helios_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.272.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_290_case_0.i, label %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_helios_qalloc.60.exit300 -cond_290_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.286.exit: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit - call void @___reset(i64 %qalloc.i267) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit300: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-apple-darwin.ll index abaa26e3..1e94f46a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-apple-darwin.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_helios_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_helios_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_helios_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_helios_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0x400921FB54442D18) +__hugr__.__tk2_helios_qalloc.60.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x400921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rxy(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_146_case_0.i, label %__hugr__.__tk2_helios_qalloc.142.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_helios_qalloc.60.exit260 -cond_146_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.142.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_160_case_0.i, label %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_helios_qalloc.60.exit264 -cond_160_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.156.exit: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit - call void @___reset(i64 %qalloc.i247) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit264: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_211_case_0.i, label %__hugr__.__tk2_helios_qalloc.207.exit - -cond_211_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_helios_qalloc.207.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_225_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_helios_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit - call void @___reset(i64 %qalloc.i257) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_helios_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_helios_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +__hugr__.__tk2_helios_qalloc.60.exit282: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_276_case_0.i, label %__hugr__.__tk2_helios_qalloc.272.exit - -cond_276_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_helios_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.272.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_290_case_0.i, label %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_helios_qalloc.60.exit300 -cond_290_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.286.exit: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit - call void @___reset(i64 %qalloc.i267) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit300: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-unknown-linux-gnu.ll index f5c1479f..09edcc5d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-unknown-linux-gnu.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_helios_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_helios_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_helios_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_helios_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0x400921FB54442D18) +__hugr__.__tk2_helios_qalloc.60.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x400921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rxy(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_146_case_0.i, label %__hugr__.__tk2_helios_qalloc.142.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_helios_qalloc.60.exit260 -cond_146_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.142.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_160_case_0.i, label %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_helios_qalloc.60.exit264 -cond_160_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.156.exit: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit - call void @___reset(i64 %qalloc.i247) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit264: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_211_case_0.i, label %__hugr__.__tk2_helios_qalloc.207.exit - -cond_211_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_helios_qalloc.207.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_225_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_helios_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit - call void @___reset(i64 %qalloc.i257) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_helios_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_helios_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +__hugr__.__tk2_helios_qalloc.60.exit282: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_276_case_0.i, label %__hugr__.__tk2_helios_qalloc.272.exit - -cond_276_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_helios_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.272.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_290_case_0.i, label %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_helios_qalloc.60.exit300 -cond_290_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.286.exit: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit - call void @___reset(i64 %qalloc.i267) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit300: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-windows-gnu.ll index df8d5aa1..1833980a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-helios-x86_64-windows-gnu.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_helios_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_helios_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_helios_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_helios_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_helios_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0x400921FB54442D18) +__hugr__.__tk2_helios_qalloc.60.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x400921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rxy(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_helios_qalloc.99.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_146_case_0.i, label %__hugr__.__tk2_helios_qalloc.142.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_helios_qalloc.60.exit260 -cond_146_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.142.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_160_case_0.i, label %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_helios_qalloc.60.exit264 -cond_160_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.156.exit: ; preds = %__hugr__.__tk2_helios_qalloc.142.exit - call void @___reset(i64 %qalloc.i247) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i245, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rxy(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit +__hugr__.__tk2_helios_qalloc.60.exit264: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rxy(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_helios_qalloc.156.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_211_case_0.i, label %__hugr__.__tk2_helios_qalloc.207.exit - -cond_211_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_helios_qalloc.207.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_225_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_helios_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %__hugr__.__tk2_helios_qalloc.207.exit - call void @___reset(i64 %qalloc.i257) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i255, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rxy(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_helios_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_helios_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +__hugr__.__tk2_helios_qalloc.60.exit282: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i275, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rxy(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_276_case_0.i, label %__hugr__.__tk2_helios_qalloc.272.exit - -cond_276_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_helios_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.272.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_290_case_0.i, label %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_helios_qalloc.60.exit300 -cond_290_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.286.exit: ; preds = %__hugr__.__tk2_helios_qalloc.272.exit - call void @___reset(i64 %qalloc.i267) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0x400921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x400921FB54442D18) - call void @___rzz(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rxy(i64 %qalloc.i265, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rxy(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit +__hugr__.__tk2_helios_qalloc.60.exit300: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x400921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x400921FB54442D18) + call void @___rzz(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0xBFF921FB54442D18) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rxy(i64 %qalloc.i293, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rxy(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_helios_qalloc.286.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_helios_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-apple-darwin.ll index 6b9ae323..fc0b23d8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-apple-darwin.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_sol_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_sol_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_sol_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_sol_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rz(i64 %qalloc.i241, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.60.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rz(i64 %qalloc.i249, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rp(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_144_case_0.i, label %__hugr__.__tk2_sol_qalloc.140.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_sol_qalloc.60.exit260 -cond_144_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.140.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_158_case_0.i, label %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_sol_qalloc.60.exit264 -cond_158_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.154.exit: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit - call void @___reset(i64 %qalloc.i247) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit264: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_207_case_0.i, label %__hugr__.__tk2_sol_qalloc.203.exit - -cond_207_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_sol_qalloc.203.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_221_case_0.i, label %__hugr__.__tk2_sol_qalloc.217.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_221_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_sol_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.217.exit: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit - call void @___reset(i64 %qalloc.i257) - call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_sol_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_sol_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit +__hugr__.__tk2_sol_qalloc.60.exit282: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rz(i64 %qalloc.i279, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_270_case_0.i, label %__hugr__.__tk2_sol_qalloc.266.exit - -cond_270_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_sol_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.266.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_284_case_0.i, label %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_sol_qalloc.60.exit300 -cond_284_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.280.exit: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit - call void @___reset(i64 %qalloc.i267) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit300: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-unknown-linux-gnu.ll index f445ede2..2f616ed3 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-aarch64-unknown-linux-gnu.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_sol_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_sol_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_sol_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_sol_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rz(i64 %qalloc.i241, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.60.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rz(i64 %qalloc.i249, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rp(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_144_case_0.i, label %__hugr__.__tk2_sol_qalloc.140.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_sol_qalloc.60.exit260 -cond_144_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.140.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_158_case_0.i, label %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_sol_qalloc.60.exit264 -cond_158_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.154.exit: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit - call void @___reset(i64 %qalloc.i247) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit264: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_207_case_0.i, label %__hugr__.__tk2_sol_qalloc.203.exit - -cond_207_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_sol_qalloc.203.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_221_case_0.i, label %__hugr__.__tk2_sol_qalloc.217.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_221_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_sol_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.217.exit: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit - call void @___reset(i64 %qalloc.i257) - call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_sol_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_sol_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit +__hugr__.__tk2_sol_qalloc.60.exit282: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rz(i64 %qalloc.i279, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_270_case_0.i, label %__hugr__.__tk2_sol_qalloc.266.exit - -cond_270_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_sol_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.266.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_284_case_0.i, label %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_sol_qalloc.60.exit300 -cond_284_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.280.exit: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit - call void @___reset(i64 %qalloc.i267) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit300: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-apple-darwin.ll index d17cf6a3..1c855a03 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-apple-darwin.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_sol_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_sol_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_sol_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_sol_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rz(i64 %qalloc.i241, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.60.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rz(i64 %qalloc.i249, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rp(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_144_case_0.i, label %__hugr__.__tk2_sol_qalloc.140.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_sol_qalloc.60.exit260 -cond_144_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.140.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_158_case_0.i, label %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_sol_qalloc.60.exit264 -cond_158_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.154.exit: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit - call void @___reset(i64 %qalloc.i247) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit264: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_207_case_0.i, label %__hugr__.__tk2_sol_qalloc.203.exit - -cond_207_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_sol_qalloc.203.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_221_case_0.i, label %__hugr__.__tk2_sol_qalloc.217.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_221_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_sol_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.217.exit: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit - call void @___reset(i64 %qalloc.i257) - call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_sol_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_sol_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit +__hugr__.__tk2_sol_qalloc.60.exit282: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rz(i64 %qalloc.i279, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_270_case_0.i, label %__hugr__.__tk2_sol_qalloc.266.exit - -cond_270_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_sol_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.266.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_284_case_0.i, label %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_sol_qalloc.60.exit300 -cond_284_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.280.exit: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit - call void @___reset(i64 %qalloc.i267) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit300: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-unknown-linux-gnu.ll index 0d9d2c0e..8ecfa70d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-unknown-linux-gnu.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_sol_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_sol_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_sol_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_sol_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rz(i64 %qalloc.i241, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.60.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rz(i64 %qalloc.i249, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rp(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_144_case_0.i, label %__hugr__.__tk2_sol_qalloc.140.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_sol_qalloc.60.exit260 -cond_144_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.140.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_158_case_0.i, label %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_sol_qalloc.60.exit264 -cond_158_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.154.exit: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit - call void @___reset(i64 %qalloc.i247) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit264: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_207_case_0.i, label %__hugr__.__tk2_sol_qalloc.203.exit - -cond_207_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_sol_qalloc.203.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_221_case_0.i, label %__hugr__.__tk2_sol_qalloc.217.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_221_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_sol_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.217.exit: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit - call void @___reset(i64 %qalloc.i257) - call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_sol_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_sol_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit +__hugr__.__tk2_sol_qalloc.60.exit282: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rz(i64 %qalloc.i279, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_270_case_0.i, label %__hugr__.__tk2_sol_qalloc.266.exit - -cond_270_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_sol_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.266.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_284_case_0.i, label %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_sol_qalloc.60.exit300 -cond_284_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.280.exit: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit - call void @___reset(i64 %qalloc.i267) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit300: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-windows-gnu.ll index 20f575f1..ef6b5adb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cy/cy_test-sol-x86_64-windows-gnu.ll @@ -4,6 +4,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_00.00F9F73D.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:00" @res_01.2F21FB33.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:01" @res_10.90CD55C3.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:10" @@ -14,36 +15,36 @@ define internal fastcc void @__hugr__.main.1() unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_89_case_0.i, label %__hugr__.__tk2_sol_qalloc.85.exit + br i1 %not_max.not.not.i, label %cond_64_case_0.i, label %__hugr__.__tk2_sol_qalloc.60.exit -cond_89_case_0.i: ; preds = %alloca_block +cond_64_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.85.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.60.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i241 = tail call i64 @___qalloc() - %not_max.not.not.i242 = icmp eq i64 %qalloc.i241, -1 - br i1 %not_max.not.not.i242, label %cond_103_case_0.i, label %__hugr__.__tk2_sol_qalloc.99.exit + %qalloc.i249 = tail call i64 @___qalloc() + %not_max.not.not.i250 = icmp eq i64 %qalloc.i249, -1 + br i1 %not_max.not.not.i250, label %cond_64_case_0.i251, label %__hugr__.__tk2_sol_qalloc.60.exit252 -cond_103_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit +cond_64_case_0.i251: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_qalloc.85.exit - tail call void @___reset(i64 %qalloc.i241) - tail call void @___rz(i64 %qalloc.i241, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.60.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit + tail call void @___reset(i64 %qalloc.i249) + tail call void @___rz(i64 %qalloc.i249, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i241, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i241, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rz(i64 %qalloc.i241, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i249, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i249, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rz(i64 %qalloc.i249, double 0x3FF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i241, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i241) - tail call void @___qfree(i64 %qalloc.i241) + tail call void @___rp(i64 %qalloc.i249, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure6 = tail call i64 @___lazy_measure(i64 %qalloc.i249) + tail call void @___qfree(i64 %qalloc.i249) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure6) tail call void @___dec_future_refcount(i64 %lazy_measure6) %read_bool9 = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -60,294 +61,362 @@ __hugr__.__tk2_sol_qalloc.99.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.99.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit252 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 %8 = load i16, ptr %0, align 1 store i16 %8, ptr %6, align 1 - tail call void @heap_free(ptr nonnull %6) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 3 - store i64 %10, ptr %1, align 4 - %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit244, label %mask_block_err.i243 - -mask_block_err.i243: ; preds = %__barray_check_none_borrowed.exit + %9 = load i64, ptr %7, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i, label %__barray_mask_check_not_borrowed.exit + +panic.i: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_check_none_borrowed.exit + %11 = and i64 %9, 2 + %.not = icmp eq i64 %11, 0 + br i1 %.not, label %__barray_mask_check_not_borrowed.exit254, label %panic.i253 + +panic.i253: ; preds = %__barray_mask_check_not_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit254: ; preds = %__barray_mask_check_not_borrowed.exit + %12 = load i64, ptr %1, align 4 + %13 = and i64 %12, 3 + store i64 %13, ptr %1, align 4 + %14 = icmp eq i64 %13, 0 + br i1 %14, label %__barray_check_none_borrowed.exit256, label %mask_block_err.i255 + +mask_block_err.i255: ; preds = %__barray_mask_check_not_borrowed.exit254 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit244: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit256: ; preds = %__barray_mask_check_not_borrowed.exit254 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %12 = alloca [2 x i1], align 1 - store i1 false, ptr %12, align 1 - %.repack237 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack237, align 1 + %15 = alloca [2 x i1], align 1 + store i1 false, ptr %15, align 1 + %.repack245 = getelementptr inbounds nuw i8, ptr %15, i64 1 + store i1 false, ptr %.repack245, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 - store ptr %12, ptr %mask_ptr, align 8 + store ptr %15, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_00.00F9F73D.0, i64 15, ptr nonnull %out_arr_alloca) - %qalloc.i245 = call i64 @___qalloc() - %not_max.not.not.i246 = icmp eq i64 %qalloc.i245, -1 - br i1 %not_max.not.not.i246, label %cond_144_case_0.i, label %__hugr__.__tk2_sol_qalloc.140.exit + %qalloc.i257 = call i64 @___qalloc() + %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 + br i1 %not_max.not.not.i258, label %cond_64_case_0.i259, label %__hugr__.__tk2_sol_qalloc.60.exit260 -cond_144_case_0.i: ; preds = %__barray_check_none_borrowed.exit244 +cond_64_case_0.i259: ; preds = %__barray_check_none_borrowed.exit256 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.140.exit: ; preds = %__barray_check_none_borrowed.exit244 - call void @___reset(i64 %qalloc.i245) - %qalloc.i247 = call i64 @___qalloc() - %not_max.not.not.i248 = icmp eq i64 %qalloc.i247, -1 - br i1 %not_max.not.not.i248, label %cond_158_case_0.i, label %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit260: ; preds = %__barray_check_none_borrowed.exit256 + call void @___reset(i64 %qalloc.i257) + %qalloc.i261 = call i64 @___qalloc() + %not_max.not.not.i262 = icmp eq i64 %qalloc.i261, -1 + br i1 %not_max.not.not.i262, label %cond_64_case_0.i263, label %__hugr__.__tk2_sol_qalloc.60.exit264 -cond_158_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit +cond_64_case_0.i263: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.154.exit: ; preds = %__hugr__.__tk2_sol_qalloc.140.exit - call void @___reset(i64 %qalloc.i247) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i245, i64 %qalloc.i247, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i247, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i247, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i245, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i245, double 0xBFF921FB54442D18) - %lazy_measure29 = call i64 @___lazy_measure(i64 %qalloc.i245) - call void @___qfree(i64 %qalloc.i245) - call void @___rp(i64 %qalloc.i247, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure32 = call i64 @___lazy_measure(i64 %qalloc.i247) - call void @___qfree(i64 %qalloc.i247) - %read_bool34 = call i1 @___read_future_bool(i64 %lazy_measure32) - call void @___dec_future_refcount(i64 %lazy_measure32) - %read_bool37 = call i1 @___read_future_bool(i64 %lazy_measure29) - call void @___dec_future_refcount(i64 %lazy_measure29) - %13 = call ptr @heap_alloc(i64 2) - %14 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %14, align 1 - store i1 %read_bool37, ptr %13, align 1 - %15 = getelementptr inbounds nuw i8, ptr %13, i64 1 - store i1 %read_bool34, ptr %15, align 1 - %16 = load i64, ptr %14, align 4 - %17 = and i64 %16, 3 - store i64 %17, ptr %14, align 4 - %18 = icmp eq i64 %17, 0 - br i1 %18, label %__barray_check_none_borrowed.exit252, label %mask_block_err.i251 - -mask_block_err.i251: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit +__hugr__.__tk2_sol_qalloc.60.exit264: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit260 + call void @___reset(i64 %qalloc.i261) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i257, i64 %qalloc.i261, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i261, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i261, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) + %lazy_measure31 = call i64 @___lazy_measure(i64 %qalloc.i257) + call void @___qfree(i64 %qalloc.i257) + call void @___rp(i64 %qalloc.i261, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure34 = call i64 @___lazy_measure(i64 %qalloc.i261) + call void @___qfree(i64 %qalloc.i261) + %read_bool36 = call i1 @___read_future_bool(i64 %lazy_measure34) + call void @___dec_future_refcount(i64 %lazy_measure34) + %read_bool39 = call i1 @___read_future_bool(i64 %lazy_measure31) + call void @___dec_future_refcount(i64 %lazy_measure31) + %16 = call ptr @heap_alloc(i64 2) + %17 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i1 %read_bool39, ptr %16, align 1 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 + store i1 %read_bool36, ptr %18, align 1 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_check_none_borrowed.exit268, label %mask_block_err.i267 + +mask_block_err.i267: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit252: ; preds = %__hugr__.__tk2_sol_qalloc.154.exit - %19 = call ptr @heap_alloc(i64 2) - %20 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %20, align 1 - %21 = load i16, ptr %13, align 1 - store i16 %21, ptr %19, align 1 - call void @heap_free(ptr nonnull %19) - %22 = load i64, ptr %14, align 4 - %23 = and i64 %22, 3 - store i64 %23, ptr %14, align 4 - %24 = icmp eq i64 %23, 0 - br i1 %24, label %__barray_check_none_borrowed.exit254, label %mask_block_err.i253 - -mask_block_err.i253: ; preds = %__barray_check_none_borrowed.exit252 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_none_borrowed.exit268: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit264 + %22 = call ptr @heap_alloc(i64 2) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i16, ptr %16, align 1 + store i16 %24, ptr %22, align 1 + %25 = load i64, ptr %23, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %panic.i269, label %__barray_mask_check_not_borrowed.exit270 + +panic.i269: ; preds = %__barray_check_none_borrowed.exit268 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_none_borrowed.exit254: ; preds = %__barray_check_none_borrowed.exit252 - %out_arr_alloca58 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 4 - %arr_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 8 - %mask_ptr62 = getelementptr inbounds nuw i8, ptr %out_arr_alloca58, i64 16 - %25 = alloca [2 x i1], align 1 - store i1 false, ptr %25, align 1 - %.repack238 = getelementptr inbounds nuw i8, ptr %25, i64 1 - store i1 false, ptr %.repack238, align 1 - store i32 2, ptr %out_arr_alloca58, align 8 - store i32 1, ptr %y_ptr60, align 4 - store ptr %13, ptr %arr_ptr61, align 8 - store ptr %25, ptr %mask_ptr62, align 8 - call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca58) - %qalloc.i255 = call i64 @___qalloc() - %not_max.not.not.i256 = icmp eq i64 %qalloc.i255, -1 - br i1 %not_max.not.not.i256, label %cond_207_case_0.i, label %__hugr__.__tk2_sol_qalloc.203.exit - -cond_207_case_0.i: ; preds = %__barray_check_none_borrowed.exit254 - call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +__barray_mask_check_not_borrowed.exit270: ; preds = %__barray_check_none_borrowed.exit268 + %27 = and i64 %25, 2 + %.not311 = icmp eq i64 %27, 0 + br i1 %.not311, label %__barray_mask_check_not_borrowed.exit272, label %panic.i271 + +panic.i271: ; preds = %__barray_mask_check_not_borrowed.exit270 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__hugr__.__tk2_sol_qalloc.203.exit: ; preds = %__barray_check_none_borrowed.exit254 - call void @___reset(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i255, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i257 = call i64 @___qalloc() - %not_max.not.not.i258 = icmp eq i64 %qalloc.i257, -1 - br i1 %not_max.not.not.i258, label %cond_221_case_0.i, label %__hugr__.__tk2_sol_qalloc.217.exit +__barray_mask_check_not_borrowed.exit272: ; preds = %__barray_mask_check_not_borrowed.exit270 + %28 = load i64, ptr %17, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %17, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 -cond_221_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit +mask_block_err.i273: ; preds = %__barray_mask_check_not_borrowed.exit272 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit274: ; preds = %__barray_mask_check_not_borrowed.exit272 + %out_arr_alloca62 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr64 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 4 + %arr_ptr65 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 8 + %mask_ptr66 = getelementptr inbounds nuw i8, ptr %out_arr_alloca62, i64 16 + %31 = alloca [2 x i1], align 1 + store i1 false, ptr %31, align 1 + %.repack246 = getelementptr inbounds nuw i8, ptr %31, i64 1 + store i1 false, ptr %.repack246, align 1 + store i32 2, ptr %out_arr_alloca62, align 8 + store i32 1, ptr %y_ptr64, align 4 + store ptr %16, ptr %arr_ptr65, align 8 + store ptr %31, ptr %mask_ptr66, align 8 + call void @print_bool_arr(ptr nonnull @res_01.2F21FB33.0, i64 15, ptr nonnull %out_arr_alloca62) + %qalloc.i275 = call i64 @___qalloc() + %not_max.not.not.i276 = icmp eq i64 %qalloc.i275, -1 + br i1 %not_max.not.not.i276, label %cond_64_case_0.i277, label %__hugr__.__tk2_sol_qalloc.60.exit278 + +cond_64_case_0.i277: ; preds = %__barray_check_none_borrowed.exit274 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.217.exit: ; preds = %__hugr__.__tk2_sol_qalloc.203.exit - call void @___reset(i64 %qalloc.i257) - call void @___rz(i64 %qalloc.i257, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i255, i64 %qalloc.i257, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i257, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i257, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i255, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i255, double 0xBFF921FB54442D18) - %lazy_measure67 = call i64 @___lazy_measure(i64 %qalloc.i255) - call void @___qfree(i64 %qalloc.i255) - call void @___rp(i64 %qalloc.i257, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure70 = call i64 @___lazy_measure(i64 %qalloc.i257) - call void @___qfree(i64 %qalloc.i257) - %read_bool72 = call i1 @___read_future_bool(i64 %lazy_measure70) - call void @___dec_future_refcount(i64 %lazy_measure70) - %read_bool75 = call i1 @___read_future_bool(i64 %lazy_measure67) - call void @___dec_future_refcount(i64 %lazy_measure67) - %26 = call ptr @heap_alloc(i64 2) - %27 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i1 %read_bool75, ptr %26, align 1 - %28 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 %read_bool72, ptr %28, align 1 - %29 = load i64, ptr %27, align 4 - %30 = and i64 %29, 3 - store i64 %30, ptr %27, align 4 - %31 = icmp eq i64 %30, 0 - br i1 %31, label %__barray_check_none_borrowed.exit262, label %mask_block_err.i261 - -mask_block_err.i261: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__hugr__.__tk2_sol_qalloc.60.exit278: ; preds = %__barray_check_none_borrowed.exit274 + call void @___reset(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i275, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i279 = call i64 @___qalloc() + %not_max.not.not.i280 = icmp eq i64 %qalloc.i279, -1 + br i1 %not_max.not.not.i280, label %cond_64_case_0.i281, label %__hugr__.__tk2_sol_qalloc.60.exit282 + +cond_64_case_0.i281: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_none_borrowed.exit262: ; preds = %__hugr__.__tk2_sol_qalloc.217.exit +__hugr__.__tk2_sol_qalloc.60.exit282: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit278 + call void @___reset(i64 %qalloc.i279) + call void @___rz(i64 %qalloc.i279, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i275, i64 %qalloc.i279, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i279, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i279, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i275, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i275, double 0xBFF921FB54442D18) + %lazy_measure71 = call i64 @___lazy_measure(i64 %qalloc.i275) + call void @___qfree(i64 %qalloc.i275) + call void @___rp(i64 %qalloc.i279, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure74 = call i64 @___lazy_measure(i64 %qalloc.i279) + call void @___qfree(i64 %qalloc.i279) + %read_bool76 = call i1 @___read_future_bool(i64 %lazy_measure74) + call void @___dec_future_refcount(i64 %lazy_measure74) + %read_bool79 = call i1 @___read_future_bool(i64 %lazy_measure71) + call void @___dec_future_refcount(i64 %lazy_measure71) %32 = call ptr @heap_alloc(i64 2) %33 = call ptr @heap_alloc(i64 8) store i64 0, ptr %33, align 1 - %34 = load i16, ptr %26, align 1 - store i16 %34, ptr %32, align 1 - call void @heap_free(ptr nonnull %32) - %35 = load i64, ptr %27, align 4 + store i1 %read_bool79, ptr %32, align 1 + %34 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 %read_bool76, ptr %34, align 1 + %35 = load i64, ptr %33, align 4 %36 = and i64 %35, 3 - store i64 %36, ptr %27, align 4 + store i64 %36, ptr %33, align 4 %37 = icmp eq i64 %36, 0 - br i1 %37, label %__barray_check_none_borrowed.exit264, label %mask_block_err.i263 + br i1 %37, label %__barray_check_none_borrowed.exit286, label %mask_block_err.i285 -mask_block_err.i263: ; preds = %__barray_check_none_borrowed.exit262 +mask_block_err.i285: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit264: ; preds = %__barray_check_none_borrowed.exit262 - %out_arr_alloca96 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr98 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 4 - %arr_ptr99 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 8 - %mask_ptr100 = getelementptr inbounds nuw i8, ptr %out_arr_alloca96, i64 16 - %38 = alloca [2 x i1], align 1 - store i1 false, ptr %38, align 1 - %.repack239 = getelementptr inbounds nuw i8, ptr %38, i64 1 - store i1 false, ptr %.repack239, align 1 - store i32 2, ptr %out_arr_alloca96, align 8 - store i32 1, ptr %y_ptr98, align 4 - store ptr %26, ptr %arr_ptr99, align 8 - store ptr %38, ptr %mask_ptr100, align 8 - call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca96) - %qalloc.i265 = call i64 @___qalloc() - %not_max.not.not.i266 = icmp eq i64 %qalloc.i265, -1 - br i1 %not_max.not.not.i266, label %cond_270_case_0.i, label %__hugr__.__tk2_sol_qalloc.266.exit - -cond_270_case_0.i: ; preds = %__barray_check_none_borrowed.exit264 +__barray_check_none_borrowed.exit286: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit282 + %38 = call ptr @heap_alloc(i64 2) + %39 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %39, align 1 + %40 = load i16, ptr %32, align 1 + store i16 %40, ptr %38, align 1 + %41 = load i64, ptr %39, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i287, label %__barray_mask_check_not_borrowed.exit288 + +panic.i287: ; preds = %__barray_check_none_borrowed.exit286 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit288: ; preds = %__barray_check_none_borrowed.exit286 + %43 = and i64 %41, 2 + %.not312 = icmp eq i64 %43, 0 + br i1 %.not312, label %__barray_mask_check_not_borrowed.exit290, label %panic.i289 + +panic.i289: ; preds = %__barray_mask_check_not_borrowed.exit288 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit290: ; preds = %__barray_mask_check_not_borrowed.exit288 + %44 = load i64, ptr %33, align 4 + %45 = and i64 %44, 3 + store i64 %45, ptr %33, align 4 + %46 = icmp eq i64 %45, 0 + br i1 %46, label %__barray_check_none_borrowed.exit292, label %mask_block_err.i291 + +mask_block_err.i291: ; preds = %__barray_mask_check_not_borrowed.exit290 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit292: ; preds = %__barray_mask_check_not_borrowed.exit290 + %out_arr_alloca102 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr104 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 4 + %arr_ptr105 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 8 + %mask_ptr106 = getelementptr inbounds nuw i8, ptr %out_arr_alloca102, i64 16 + %47 = alloca [2 x i1], align 1 + store i1 false, ptr %47, align 1 + %.repack247 = getelementptr inbounds nuw i8, ptr %47, i64 1 + store i1 false, ptr %.repack247, align 1 + store i32 2, ptr %out_arr_alloca102, align 8 + store i32 1, ptr %y_ptr104, align 4 + store ptr %32, ptr %arr_ptr105, align 8 + store ptr %47, ptr %mask_ptr106, align 8 + call void @print_bool_arr(ptr nonnull @res_10.90CD55C3.0, i64 15, ptr nonnull %out_arr_alloca102) + %qalloc.i293 = call i64 @___qalloc() + %not_max.not.not.i294 = icmp eq i64 %qalloc.i293, -1 + br i1 %not_max.not.not.i294, label %cond_64_case_0.i295, label %__hugr__.__tk2_sol_qalloc.60.exit296 + +cond_64_case_0.i295: ; preds = %__barray_check_none_borrowed.exit292 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.266.exit: ; preds = %__barray_check_none_borrowed.exit264 - call void @___reset(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i265, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i267 = call i64 @___qalloc() - %not_max.not.not.i268 = icmp eq i64 %qalloc.i267, -1 - br i1 %not_max.not.not.i268, label %cond_284_case_0.i, label %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit296: ; preds = %__barray_check_none_borrowed.exit292 + call void @___reset(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i293, double 0x400921FB54442D18, double 0.000000e+00) + %qalloc.i297 = call i64 @___qalloc() + %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 + br i1 %not_max.not.not.i298, label %cond_64_case_0.i299, label %__hugr__.__tk2_sol_qalloc.60.exit300 -cond_284_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit +cond_64_case_0.i299: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.280.exit: ; preds = %__hugr__.__tk2_sol_qalloc.266.exit - call void @___reset(i64 %qalloc.i267) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0xBFF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rpp(i64 %qalloc.i265, i64 %qalloc.i267, double 0x3FF921FB54442D18, double 0.000000e+00) - call void @___rp(i64 %qalloc.i267, double 0xBFF921FB54442D18, double 0.000000e+00) - call void @___rz(i64 %qalloc.i267, double 0x3FF921FB54442D18) - call void @___rp(i64 %qalloc.i265, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - call void @___rz(i64 %qalloc.i265, double 0xBFF921FB54442D18) - %lazy_measure106 = call i64 @___lazy_measure(i64 %qalloc.i265) - call void @___qfree(i64 %qalloc.i265) - call void @___rp(i64 %qalloc.i267, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - %lazy_measure109 = call i64 @___lazy_measure(i64 %qalloc.i267) - call void @___qfree(i64 %qalloc.i267) - %read_bool111 = call i1 @___read_future_bool(i64 %lazy_measure109) - call void @___dec_future_refcount(i64 %lazy_measure109) - %read_bool114 = call i1 @___read_future_bool(i64 %lazy_measure106) - call void @___dec_future_refcount(i64 %lazy_measure106) - %39 = call ptr @heap_alloc(i64 2) - %40 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %40, align 1 - store i1 %read_bool114, ptr %39, align 1 - %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 - store i1 %read_bool111, ptr %41, align 1 - %42 = load i64, ptr %40, align 4 - %43 = and i64 %42, 3 - store i64 %43, ptr %40, align 4 - %44 = icmp eq i64 %43, 0 - br i1 %44, label %__barray_check_none_borrowed.exit272, label %mask_block_err.i271 - -mask_block_err.i271: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit +__hugr__.__tk2_sol_qalloc.60.exit300: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit296 + call void @___reset(i64 %qalloc.i297) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rpp(i64 %qalloc.i293, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) + call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) + call void @___rz(i64 %qalloc.i297, double 0x3FF921FB54442D18) + call void @___rp(i64 %qalloc.i293, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + call void @___rz(i64 %qalloc.i293, double 0xBFF921FB54442D18) + %lazy_measure112 = call i64 @___lazy_measure(i64 %qalloc.i293) + call void @___qfree(i64 %qalloc.i293) + call void @___rp(i64 %qalloc.i297, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + %lazy_measure115 = call i64 @___lazy_measure(i64 %qalloc.i297) + call void @___qfree(i64 %qalloc.i297) + %read_bool117 = call i1 @___read_future_bool(i64 %lazy_measure115) + call void @___dec_future_refcount(i64 %lazy_measure115) + %read_bool120 = call i1 @___read_future_bool(i64 %lazy_measure112) + call void @___dec_future_refcount(i64 %lazy_measure112) + %48 = call ptr @heap_alloc(i64 2) + %49 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %49, align 1 + store i1 %read_bool120, ptr %48, align 1 + %50 = getelementptr inbounds nuw i8, ptr %48, i64 1 + store i1 %read_bool117, ptr %50, align 1 + %51 = load i64, ptr %49, align 4 + %52 = and i64 %51, 3 + store i64 %52, ptr %49, align 4 + %53 = icmp eq i64 %52, 0 + br i1 %53, label %__barray_check_none_borrowed.exit304, label %mask_block_err.i303 + +mask_block_err.i303: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit272: ; preds = %__hugr__.__tk2_sol_qalloc.280.exit - %45 = call ptr @heap_alloc(i64 2) - %46 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %46, align 1 - %47 = load i16, ptr %39, align 1 - store i16 %47, ptr %45, align 1 - call void @heap_free(ptr nonnull %45) - %48 = load i64, ptr %40, align 4 - %49 = and i64 %48, 3 - store i64 %49, ptr %40, align 4 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %__barray_check_none_borrowed.exit274, label %mask_block_err.i273 - -mask_block_err.i273: ; preds = %__barray_check_none_borrowed.exit272 +__barray_check_none_borrowed.exit304: ; preds = %__hugr__.__tk2_sol_qalloc.60.exit300 + %54 = call ptr @heap_alloc(i64 2) + %55 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %55, align 1 + %56 = load i16, ptr %48, align 1 + store i16 %56, ptr %54, align 1 + %57 = load i64, ptr %55, align 4 + %58 = trunc i64 %57 to i1 + br i1 %58, label %panic.i305, label %__barray_mask_check_not_borrowed.exit306 + +panic.i305: ; preds = %__barray_check_none_borrowed.exit304 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit306: ; preds = %__barray_check_none_borrowed.exit304 + %59 = and i64 %57, 2 + %.not313 = icmp eq i64 %59, 0 + br i1 %.not313, label %__barray_mask_check_not_borrowed.exit308, label %panic.i307 + +panic.i307: ; preds = %__barray_mask_check_not_borrowed.exit306 + call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_check_not_borrowed.exit308: ; preds = %__barray_mask_check_not_borrowed.exit306 + %60 = load i64, ptr %49, align 4 + %61 = and i64 %60, 3 + store i64 %61, ptr %49, align 4 + %62 = icmp eq i64 %61, 0 + br i1 %62, label %__barray_check_none_borrowed.exit310, label %mask_block_err.i309 + +mask_block_err.i309: ; preds = %__barray_mask_check_not_borrowed.exit308 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit274: ; preds = %__barray_check_none_borrowed.exit272 - %out_arr_alloca135 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr137 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 4 - %arr_ptr138 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 8 - %mask_ptr139 = getelementptr inbounds nuw i8, ptr %out_arr_alloca135, i64 16 - %51 = alloca [2 x i1], align 1 - store i1 false, ptr %51, align 1 - %.repack240 = getelementptr inbounds nuw i8, ptr %51, i64 1 - store i1 false, ptr %.repack240, align 1 - store i32 2, ptr %out_arr_alloca135, align 8 - store i32 1, ptr %y_ptr137, align 4 - store ptr %39, ptr %arr_ptr138, align 8 - store ptr %51, ptr %mask_ptr139, align 8 - call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca135) +__barray_check_none_borrowed.exit310: ; preds = %__barray_mask_check_not_borrowed.exit308 + %out_arr_alloca143 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr145 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 4 + %arr_ptr146 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 8 + %mask_ptr147 = getelementptr inbounds nuw i8, ptr %out_arr_alloca143, i64 16 + %63 = alloca [2 x i1], align 1 + store i1 false, ptr %63, align 1 + %.repack248 = getelementptr inbounds nuw i8, ptr %63, i64 1 + store i1 false, ptr %.repack248, align 1 + store i32 2, ptr %out_arr_alloca143, align 8 + store i32 1, ptr %y_ptr145, align 4 + store ptr %48, ptr %arr_ptr146, align 8 + store ptr %63, ptr %mask_ptr147, align 8 + call void @print_bool_arr(ptr nonnull @res_11.7D0DF573.0, i64 15, ptr nonnull %out_arr_alloca143) ret void } @@ -364,8 +433,6 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @heap_free(ptr) local_unnamed_addr - declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-apple-darwin.ll index 1490574b..877de2f1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-apple-darwin.ll @@ -11,44 +11,44 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_helios_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_helios_qalloc.61.exit + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_helios_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.23.exit47: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -57,11 +57,11 @@ __hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -72,21 +72,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_heli %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-unknown-linux-gnu.ll index c661a7e0..56fd4471 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-aarch64-unknown-linux-gnu.ll @@ -11,44 +11,44 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_helios_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_helios_qalloc.61.exit + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_helios_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.23.exit47: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -57,11 +57,11 @@ __hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -72,21 +72,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_heli %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-apple-darwin.ll index ec64dde5..54fc439f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-apple-darwin.ll @@ -11,44 +11,44 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_helios_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_helios_qalloc.61.exit + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_helios_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.23.exit47: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -57,11 +57,11 @@ __hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -72,21 +72,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_heli %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-unknown-linux-gnu.ll index f9164f0f..85df48bb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-unknown-linux-gnu.ll @@ -11,44 +11,44 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_helios_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_helios_qalloc.61.exit + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_helios_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.23.exit47: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -57,11 +57,11 @@ __hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -72,21 +72,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_heli %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-windows-gnu.ll index 3187fad3..7b7fd00c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-helios-x86_64-windows-gnu.ll @@ -11,44 +11,44 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_helios_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_helios_qalloc.61.exit + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_helios_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_helios_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.23.exit47: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -57,11 +57,11 @@ __hugr__.__tk2_helios_qalloc.61.exit: ; preds = %__hugr__.__tk2_heli %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -72,21 +72,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_heli %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-apple-darwin.ll index 285c69b4..2b080d5d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-apple-darwin.ll @@ -11,52 +11,52 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_sol_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_sol_qalloc.61.exit + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_sol_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.23.exit47: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -65,11 +65,11 @@ __hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -80,21 +80,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_ %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-unknown-linux-gnu.ll index 2f0df9bf..7c8ae0ef 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-aarch64-unknown-linux-gnu.ll @@ -11,52 +11,52 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_sol_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_sol_qalloc.61.exit + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_sol_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.23.exit47: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -65,11 +65,11 @@ __hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -80,21 +80,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_ %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-apple-darwin.ll index 51193520..23926e8e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-apple-darwin.ll @@ -11,52 +11,52 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_sol_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_sol_qalloc.61.exit + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_sol_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.23.exit47: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -65,11 +65,11 @@ __hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -80,21 +80,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_ %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-unknown-linux-gnu.ll index 445d2666..7badda17 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-unknown-linux-gnu.ll @@ -11,52 +11,52 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_sol_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_sol_qalloc.61.exit + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_sol_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.23.exit47: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -65,11 +65,11 @@ __hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -80,21 +80,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_ %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-windows-gnu.ll index c0fad93c..79ac8084 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_cz/cz_test-sol-x86_64-windows-gnu.ll @@ -11,52 +11,52 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_51_case_0.i, label %__hugr__.__tk2_sol_qalloc.47.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_51_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.47.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i49 = tail call i64 @___qalloc() - %not_max.not.not.i50 = icmp eq i64 %qalloc.i49, -1 - br i1 %not_max.not.not.i50, label %cond_65_case_0.i, label %__hugr__.__tk2_sol_qalloc.61.exit + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + %qalloc.i44 = tail call i64 @___qalloc() + %not_max.not.not.i45 = icmp eq i64 %qalloc.i44, -1 + br i1 %not_max.not.not.i45, label %cond_27_case_0.i46, label %__hugr__.__tk2_sol_qalloc.23.exit47 -cond_65_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit +cond_27_case_0.i46: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_qalloc.47.exit - tail call void @___reset(i64 %qalloc.i49) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) +__hugr__.__tk2_sol_qalloc.23.exit47: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i44) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i, double 0x40316444CB580C0B, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i, double 0x40134D1C84D7D5F9, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i49, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i49, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i44, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i44, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %lazy_measure10 = tail call i64 @___lazy_measure(i64 %qalloc.i49) - tail call void @___qfree(i64 %qalloc.i49) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure10) - tail call void @___dec_future_refcount(i64 %lazy_measure10) - %read_bool13 = tail call i1 @___read_future_bool(i64 %lazy_measure) + %lazy_measure11 = tail call i64 @___lazy_measure(i64 %qalloc.i44) + tail call void @___qfree(i64 %qalloc.i44) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure11) + tail call void @___dec_future_refcount(i64 %lazy_measure11) + %read_bool14 = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) %0 = tail call ptr @heap_alloc(i64 2) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 - store i1 %read_bool13, ptr %0, align 1 + store i1 %read_bool14, ptr %0, align 1 %2 = getelementptr inbounds nuw i8, ptr %0, i64 1 store i1 %read_bool, ptr %2, align 1 %3 = load i64, ptr %1, align 4 @@ -65,11 +65,11 @@ __hugr__.__tk2_sol_qalloc.61.exit: ; preds = %__hugr__.__tk2_sol_ %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_check_none_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.61.exit +__barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit47 %6 = tail call ptr @heap_alloc(i64 2) %7 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %7, align 1 @@ -80,21 +80,21 @@ __barray_check_none_borrowed.exit: ; preds = %__hugr__.__tk2_sol_ %10 = and i64 %9, 3 store i64 %10, ptr %1, align 4 %11 = icmp eq i64 %10, 0 - br i1 %11, label %__barray_check_none_borrowed.exit54, label %mask_block_err.i53 + br i1 %11, label %__barray_check_none_borrowed.exit51, label %mask_block_err.i50 -mask_block_err.i53: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i50: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit54: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit51: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %12 = alloca [2 x i1], align 1 store i1 false, ptr %12, align 1 - %.repack48 = getelementptr inbounds nuw i8, ptr %12, i64 1 - store i1 false, ptr %.repack48, align 1 + %.repack43 = getelementptr inbounds nuw i8, ptr %12, i64 1 + store i1 false, ptr %.repack43, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-apple-darwin.ll index 49f8e793..0bfeb1ef 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-unknown-linux-gnu.ll index 97ee0888..883bf6a3 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-apple-darwin.ll index be7a3b78..11673473 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-unknown-linux-gnu.ll index 2a7dda42..b4838677 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-windows-gnu.ll index 2f36b2ff..68e712ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-helios-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-apple-darwin.ll index 1aecd1c4..8be3d288 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-unknown-linux-gnu.ll index 3e9ecef0..54bfdda0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-apple-darwin.ll index 4a62ede3..c40f1810 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-unknown-linux-gnu.ll index 68ee5efd..77600b40 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-windows-gnu.ll index 7a954387..c4322251 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_exit/exit-sol-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-apple-darwin.ll index 86687a2b..87d3d821 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-apple-darwin.ll @@ -5,511 +5,516 @@ target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.383.exit.2, %__hugr__.__tk2_helios_qalloc.383.exit.1, %__hugr__.__tk2_helios_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.305.exit.2, %__hugr__.__tk2_helios_qalloc.305.exit.1, %__hugr__.__tk2_helios_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.1 -__hugr__.__tk2_helios_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not219 = icmp eq i64 %6, 0 - br i1 %.not219, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.2 -__hugr__.__tk2_helios_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not220 = icmp eq i64 %10, 0 - br i1 %.not220, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not221 = icmp eq i64 %14, 0 - br i1 %.not221, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not199 = icmp eq i64 %29, 0 - br i1 %.not199, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not200 = icmp eq i64 %32, 0 - br i1 %.not200, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not201 = icmp eq i64 %36, 0 - br i1 %.not201, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i177: ; preds = %__barray_mask_borrow.exit176 +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread + +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i194, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not202 = icmp eq i64 %52, 0 - br i1 %.not202, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not203 = icmp eq i64 %60, 0 - br i1 %.not203, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not204 = icmp eq i64 %68, 0 - br i1 %.not204, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i194: ; preds = %__barray_check_bounds.exit.i.3.i183, %loop_body.1.i182, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.3.i, %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %82 = and i64 %80, -2 - store i64 %82, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %83 = load i64, ptr %43, align 4 - %84 = trunc i64 %83 to i1 - br i1 %84, label %loop_body.i180, label %panic.i.i179 - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %cond_exit_433.thread.3.i.i - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %85 = load i64, ptr %43, align 4 - %86 = and i64 %85, 15 - store i64 %86, ptr %43, align 4 - %87 = icmp eq i64 %86, 0 - br i1 %87, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i189: ; preds = %cond_exit_433.thread.3.i.i +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.3.i185 - %88 = or disjoint i64 %139, 1 - store i64 %88, ptr %39, align 4 - %89 = load i64, ptr %38, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 tail call void @___dec_future_refcount(i64 %89) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i + br label %cond_exit_356 -cond_exit_433.thread.i.i: ; preds = %loop_body.3.i185, %__barray_mask_borrow.exit228.i.i - %90 = phi i64 [ %139, %loop_body.3.i185 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 %91 = and i64 %90, 2 - %.not211 = icmp eq i64 %91, 0 - br i1 %.not211, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 %92 = or disjoint i64 %90, 2 - store i64 %92, ptr %39, align 4 - %93 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %93) - %.pre216 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %94 = phi i64 [ %.pre216, %__barray_mask_borrow.exit228.1.i.i ], [ %90, %cond_exit_433.thread.i.i ] - %95 = and i64 %94, 4 - %.not212 = icmp eq i64 %95, 0 - br i1 %.not212, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %96 = or disjoint i64 %94, 4 - store i64 %96, ptr %39, align 4 - %97 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %97) - %.pre217 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %98 = phi i64 [ %.pre217, %__barray_mask_borrow.exit228.2.i.i ], [ %94, %cond_exit_433.thread.1.i.i ] - %99 = and i64 %98, 8 - %.not213 = icmp eq i64 %99, 0 - br i1 %.not213, label %__barray_mask_borrow.exit228.3.i.i, label %cond_exit_433.thread.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %100 = or disjoint i64 %98, 8 - store i64 %100, ptr %39, align 4 - %101 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %101) - %.pre218 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.3.i.i - -cond_exit_433.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_433.thread.2.i.i - %102 = phi i64 [ %.pre218, %__barray_mask_borrow.exit228.3.i.i ], [ %98, %cond_exit_433.thread.2.i.i ] - %103 = or i64 %102, -16 - store i64 %103, ptr %39, align 4 - %104 = icmp eq i64 %103, -1 - br i1 %104, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i189 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.3.i184, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i180: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - %105 = and i64 %83, -2 - store i64 %105, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %106 = load i64, ptr %39, align 4 - %107 = and i64 %106, 2 - %.not205 = icmp eq i64 %107, 0 - br i1 %.not205, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i180 - %108 = or disjoint i64 %106, 2 - store i64 %108, ptr %39, align 4 - %109 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %39, align 4 - %111 = and i64 %110, 2 - %.not206 = icmp eq i64 %111, 0 - br i1 %.not206, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %112 = and i64 %110, -3 - store i64 %112, ptr %39, align 4 - store i64 %109, ptr %58, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %43, align 4 - %114 = and i64 %113, 2 - %.not.i181 = icmp eq i64 %114, 0 - br i1 %.not.i181, label %panic.i.i179, label %loop_body.1.i182 - -loop_body.1.i182: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - %115 = and i64 %113, -3 - store i64 %115, ptr %43, align 4 - %116 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.1.i, ptr %116, align 1 - %117 = load i64, ptr %39, align 4 - %118 = and i64 %117, 4 - %.not207 = icmp eq i64 %118, 0 - br i1 %.not207, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.2.i: ; preds = %loop_body.1.i182 - %119 = or disjoint i64 %117, 4 - store i64 %119, ptr %39, align 4 - %120 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %120) - %121 = load i64, ptr %39, align 4 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not208 = icmp eq i64 %122, 0 - br i1 %.not208, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i": ; preds = %__barray_check_bounds.exit221.i.2.i - %123 = and i64 %121, -5 - store i64 %123, ptr %39, align 4 - store i64 %120, ptr %66, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %120) - tail call void @___dec_future_refcount(i64 %120) - %124 = load i64, ptr %43, align 4 - %125 = and i64 %124, 4 - %.not169.i = icmp eq i64 %125, 0 - br i1 %.not169.i, label %panic.i.i179, label %__barray_check_bounds.exit.i.3.i183 - -__barray_check_bounds.exit.i.3.i183: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - %126 = and i64 %124, -5 - store i64 %126, ptr %43, align 4 - %127 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.2.i, ptr %127, align 1 - %128 = load i64, ptr %39, align 4 - %129 = and i64 %128, 8 - %.not209 = icmp eq i64 %129, 0 - br i1 %.not209, label %__barray_check_bounds.exit221.i.3.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.3.i: ; preds = %__barray_check_bounds.exit.i.3.i183 - %130 = or disjoint i64 %128, 8 - store i64 %130, ptr %39, align 4 - %131 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %131) - %132 = load i64, ptr %39, align 4 - %133 = and i64 %132, 8 - %.not210 = icmp eq i64 %133, 0 - br i1 %.not210, label %panic.i222.i.i, label %__barray_check_bounds.exit.3.i184 - -__barray_check_bounds.exit.3.i184: ; preds = %__barray_check_bounds.exit221.i.3.i - %134 = and i64 %132, -9 - store i64 %134, ptr %39, align 4 - store i64 %131, ptr %74, align 4 - %read_bool.3.i = tail call i1 @___read_future_bool(i64 %131) - tail call void @___dec_future_refcount(i64 %131) - %135 = load i64, ptr %43, align 4 - %136 = and i64 %135, 8 - %.not170.i = icmp eq i64 %136, 0 - br i1 %.not170.i, label %panic.i.i179, label %loop_body.3.i185 - -loop_body.3.i185: ; preds = %__barray_check_bounds.exit.3.i184 - %137 = and i64 %135, -9 - store i64 %137, ptr %43, align 4 - %138 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.3.i, ptr %138, align 1 - %139 = load i64, ptr %39, align 4 - %140 = trunc i64 %139 to i1 - br i1 %140, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit196, label %mask_block_err.i195 - -mask_block_err.i195: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit196: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-unknown-linux-gnu.ll index 68210ccf..d691023f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-aarch64-unknown-linux-gnu.ll @@ -5,511 +5,516 @@ target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.383.exit.2, %__hugr__.__tk2_helios_qalloc.383.exit.1, %__hugr__.__tk2_helios_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.305.exit.2, %__hugr__.__tk2_helios_qalloc.305.exit.1, %__hugr__.__tk2_helios_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.1 -__hugr__.__tk2_helios_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not219 = icmp eq i64 %6, 0 - br i1 %.not219, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.2 -__hugr__.__tk2_helios_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not220 = icmp eq i64 %10, 0 - br i1 %.not220, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not221 = icmp eq i64 %14, 0 - br i1 %.not221, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not199 = icmp eq i64 %29, 0 - br i1 %.not199, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not200 = icmp eq i64 %32, 0 - br i1 %.not200, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not201 = icmp eq i64 %36, 0 - br i1 %.not201, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i177: ; preds = %__barray_mask_borrow.exit176 +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread + +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i194, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not202 = icmp eq i64 %52, 0 - br i1 %.not202, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not203 = icmp eq i64 %60, 0 - br i1 %.not203, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not204 = icmp eq i64 %68, 0 - br i1 %.not204, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i194: ; preds = %__barray_check_bounds.exit.i.3.i183, %loop_body.1.i182, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.3.i, %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %82 = and i64 %80, -2 - store i64 %82, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %83 = load i64, ptr %43, align 4 - %84 = trunc i64 %83 to i1 - br i1 %84, label %loop_body.i180, label %panic.i.i179 - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %cond_exit_433.thread.3.i.i - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %85 = load i64, ptr %43, align 4 - %86 = and i64 %85, 15 - store i64 %86, ptr %43, align 4 - %87 = icmp eq i64 %86, 0 - br i1 %87, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i189: ; preds = %cond_exit_433.thread.3.i.i +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.3.i185 - %88 = or disjoint i64 %139, 1 - store i64 %88, ptr %39, align 4 - %89 = load i64, ptr %38, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 tail call void @___dec_future_refcount(i64 %89) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i + br label %cond_exit_356 -cond_exit_433.thread.i.i: ; preds = %loop_body.3.i185, %__barray_mask_borrow.exit228.i.i - %90 = phi i64 [ %139, %loop_body.3.i185 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 %91 = and i64 %90, 2 - %.not211 = icmp eq i64 %91, 0 - br i1 %.not211, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 %92 = or disjoint i64 %90, 2 - store i64 %92, ptr %39, align 4 - %93 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %93) - %.pre216 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %94 = phi i64 [ %.pre216, %__barray_mask_borrow.exit228.1.i.i ], [ %90, %cond_exit_433.thread.i.i ] - %95 = and i64 %94, 4 - %.not212 = icmp eq i64 %95, 0 - br i1 %.not212, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %96 = or disjoint i64 %94, 4 - store i64 %96, ptr %39, align 4 - %97 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %97) - %.pre217 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %98 = phi i64 [ %.pre217, %__barray_mask_borrow.exit228.2.i.i ], [ %94, %cond_exit_433.thread.1.i.i ] - %99 = and i64 %98, 8 - %.not213 = icmp eq i64 %99, 0 - br i1 %.not213, label %__barray_mask_borrow.exit228.3.i.i, label %cond_exit_433.thread.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %100 = or disjoint i64 %98, 8 - store i64 %100, ptr %39, align 4 - %101 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %101) - %.pre218 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.3.i.i - -cond_exit_433.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_433.thread.2.i.i - %102 = phi i64 [ %.pre218, %__barray_mask_borrow.exit228.3.i.i ], [ %98, %cond_exit_433.thread.2.i.i ] - %103 = or i64 %102, -16 - store i64 %103, ptr %39, align 4 - %104 = icmp eq i64 %103, -1 - br i1 %104, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i189 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.3.i184, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i180: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - %105 = and i64 %83, -2 - store i64 %105, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %106 = load i64, ptr %39, align 4 - %107 = and i64 %106, 2 - %.not205 = icmp eq i64 %107, 0 - br i1 %.not205, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i180 - %108 = or disjoint i64 %106, 2 - store i64 %108, ptr %39, align 4 - %109 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %39, align 4 - %111 = and i64 %110, 2 - %.not206 = icmp eq i64 %111, 0 - br i1 %.not206, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %112 = and i64 %110, -3 - store i64 %112, ptr %39, align 4 - store i64 %109, ptr %58, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %43, align 4 - %114 = and i64 %113, 2 - %.not.i181 = icmp eq i64 %114, 0 - br i1 %.not.i181, label %panic.i.i179, label %loop_body.1.i182 - -loop_body.1.i182: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - %115 = and i64 %113, -3 - store i64 %115, ptr %43, align 4 - %116 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.1.i, ptr %116, align 1 - %117 = load i64, ptr %39, align 4 - %118 = and i64 %117, 4 - %.not207 = icmp eq i64 %118, 0 - br i1 %.not207, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.2.i: ; preds = %loop_body.1.i182 - %119 = or disjoint i64 %117, 4 - store i64 %119, ptr %39, align 4 - %120 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %120) - %121 = load i64, ptr %39, align 4 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not208 = icmp eq i64 %122, 0 - br i1 %.not208, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i": ; preds = %__barray_check_bounds.exit221.i.2.i - %123 = and i64 %121, -5 - store i64 %123, ptr %39, align 4 - store i64 %120, ptr %66, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %120) - tail call void @___dec_future_refcount(i64 %120) - %124 = load i64, ptr %43, align 4 - %125 = and i64 %124, 4 - %.not169.i = icmp eq i64 %125, 0 - br i1 %.not169.i, label %panic.i.i179, label %__barray_check_bounds.exit.i.3.i183 - -__barray_check_bounds.exit.i.3.i183: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - %126 = and i64 %124, -5 - store i64 %126, ptr %43, align 4 - %127 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.2.i, ptr %127, align 1 - %128 = load i64, ptr %39, align 4 - %129 = and i64 %128, 8 - %.not209 = icmp eq i64 %129, 0 - br i1 %.not209, label %__barray_check_bounds.exit221.i.3.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.3.i: ; preds = %__barray_check_bounds.exit.i.3.i183 - %130 = or disjoint i64 %128, 8 - store i64 %130, ptr %39, align 4 - %131 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %131) - %132 = load i64, ptr %39, align 4 - %133 = and i64 %132, 8 - %.not210 = icmp eq i64 %133, 0 - br i1 %.not210, label %panic.i222.i.i, label %__barray_check_bounds.exit.3.i184 - -__barray_check_bounds.exit.3.i184: ; preds = %__barray_check_bounds.exit221.i.3.i - %134 = and i64 %132, -9 - store i64 %134, ptr %39, align 4 - store i64 %131, ptr %74, align 4 - %read_bool.3.i = tail call i1 @___read_future_bool(i64 %131) - tail call void @___dec_future_refcount(i64 %131) - %135 = load i64, ptr %43, align 4 - %136 = and i64 %135, 8 - %.not170.i = icmp eq i64 %136, 0 - br i1 %.not170.i, label %panic.i.i179, label %loop_body.3.i185 - -loop_body.3.i185: ; preds = %__barray_check_bounds.exit.3.i184 - %137 = and i64 %135, -9 - store i64 %137, ptr %43, align 4 - %138 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.3.i, ptr %138, align 1 - %139 = load i64, ptr %39, align 4 - %140 = trunc i64 %139 to i1 - br i1 %140, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit196, label %mask_block_err.i195 - -mask_block_err.i195: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit196: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-apple-darwin.ll index 029456ec..267db281 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-apple-darwin.ll @@ -5,511 +5,516 @@ target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.383.exit.2, %__hugr__.__tk2_helios_qalloc.383.exit.1, %__hugr__.__tk2_helios_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.305.exit.2, %__hugr__.__tk2_helios_qalloc.305.exit.1, %__hugr__.__tk2_helios_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.1 -__hugr__.__tk2_helios_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not205 = icmp eq i64 %6, 0 - br i1 %.not205, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.2 -__hugr__.__tk2_helios_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not206 = icmp eq i64 %10, 0 - br i1 %.not206, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not207 = icmp eq i64 %14, 0 - br i1 %.not207, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not194 = icmp eq i64 %29, 0 - br i1 %.not194, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not195 = icmp eq i64 %32, 0 - br i1 %.not195, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not196 = icmp eq i64 %36, 0 - br i1 %.not196, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread -panic.i177: ; preds = %__barray_mask_borrow.exit176 +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i189, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not197 = icmp eq i64 %52, 0 - br i1 %.not197, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not198 = icmp eq i64 %60, 0 - br i1 %.not198, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not199 = icmp eq i64 %68, 0 - br i1 %.not199, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i189: ; preds = %loop_body.i180.2, %loop_body.i180.1, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %__barray_check_bounds.exit.i, label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i.3, %__barray_check_bounds.exit221.i.i.2, %__barray_check_bounds.exit221.i.i.1, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -mask_block_err.i.i.i184: ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.i180.3 - %82 = or disjoint i64 %136, 1 - store i64 %82, ptr %39, align 4 - %83 = load i64, ptr %38, align 4 - tail call void @___dec_future_refcount(i64 %83) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i - -cond_exit_433.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.i180.3 - %84 = phi i64 [ %.pre, %__barray_mask_borrow.exit228.i.i ], [ %136, %loop_body.i180.3 ] - %85 = and i64 %84, 2 - %.not217 = icmp eq i64 %85, 0 - br i1 %.not217, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i - %86 = or disjoint i64 %84, 2 - store i64 %86, ptr %39, align 4 - %87 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %87) - %.pre202 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %88 = phi i64 [ %.pre202, %__barray_mask_borrow.exit228.1.i.i ], [ %84, %cond_exit_433.thread.i.i ] - %89 = and i64 %88, 4 - %.not218 = icmp eq i64 %89, 0 - br i1 %.not218, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %90 = or disjoint i64 %88, 4 - store i64 %90, ptr %39, align 4 - %91 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %91) - %.pre203 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %92 = phi i64 [ %.pre203, %__barray_mask_borrow.exit228.2.i.i ], [ %88, %cond_exit_433.thread.1.i.i ] - %93 = and i64 %92, 8 - %.not219 = icmp eq i64 %93, 0 - br i1 %.not219, label %__barray_mask_borrow.exit228.3.i.i, label %mask_block_ok.i.i.i181.preheader - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %94 = or disjoint i64 %92, 8 - store i64 %94, ptr %39, align 4 - %95 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %95) - %.pre204 = load i64, ptr %39, align 4 - br label %mask_block_ok.i.i.i181.preheader - -mask_block_ok.i.i.i181.preheader: ; preds = %cond_exit_433.thread.2.i.i, %__barray_mask_borrow.exit228.3.i.i - %96 = phi i64 [ %.pre204, %__barray_mask_borrow.exit228.3.i.i ], [ %92, %cond_exit_433.thread.2.i.i ] - %97 = or i64 %96, -16 - store i64 %97, ptr %39, align 4 - %98 = icmp eq i64 %97, -1 - br i1 %98, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i184 - -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit221.i.i - %99 = and i64 %80, -2 - store i64 %99, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %100 = load i64, ptr %43, align 4 - %101 = trunc i64 %100 to i1 - br i1 %101, label %loop_body.i180, label %panic.i.i179 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.i.3, %__barray_check_bounds.exit.i.2, %__barray_check_bounds.exit.i.1, %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i180: ; preds = %__barray_check_bounds.exit.i - %102 = and i64 %100, -2 - store i64 %102, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %103 = load i64, ptr %39, align 4 - %104 = and i64 %103, 2 - %.not208 = icmp eq i64 %104, 0 - br i1 %.not208, label %__barray_check_bounds.exit221.i.i.1, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.1: ; preds = %loop_body.i180 - %105 = or disjoint i64 %103, 2 - store i64 %105, ptr %39, align 4 - %106 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %106) - %107 = load i64, ptr %39, align 4 - %108 = and i64 %107, 2 - %.not209 = icmp eq i64 %108, 0 - br i1 %.not209, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.1 - -__barray_check_bounds.exit.i.1: ; preds = %__barray_check_bounds.exit221.i.i.1 - %109 = and i64 %107, -3 - store i64 %109, ptr %39, align 4 - store i64 %106, ptr %58, align 4 - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %106) - tail call void @___dec_future_refcount(i64 %106) - %110 = load i64, ptr %43, align 4 - %111 = and i64 %110, 2 - %.not210 = icmp eq i64 %111, 0 - br i1 %.not210, label %panic.i.i179, label %loop_body.i180.1 - -loop_body.i180.1: ; preds = %__barray_check_bounds.exit.i.1 - %112 = and i64 %110, -3 - store i64 %112, ptr %43, align 4 - %113 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.i.1, ptr %113, align 1 - %114 = load i64, ptr %39, align 4 - %115 = and i64 %114, 4 - %.not211 = icmp eq i64 %115, 0 - br i1 %.not211, label %__barray_check_bounds.exit221.i.i.2, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.2: ; preds = %loop_body.i180.1 - %116 = or disjoint i64 %114, 4 - store i64 %116, ptr %39, align 4 - %117 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %117) - %118 = load i64, ptr %39, align 4 - %119 = and i64 %118, 4 - %.not212 = icmp eq i64 %119, 0 - br i1 %.not212, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.2 - -__barray_check_bounds.exit.i.2: ; preds = %__barray_check_bounds.exit221.i.i.2 - %120 = and i64 %118, -5 - store i64 %120, ptr %39, align 4 - store i64 %117, ptr %66, align 4 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %117) - tail call void @___dec_future_refcount(i64 %117) - %121 = load i64, ptr %43, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_356 + +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not213 = icmp eq i64 %122, 0 - br i1 %.not213, label %panic.i.i179, label %loop_body.i180.2 - -loop_body.i180.2: ; preds = %__barray_check_bounds.exit.i.2 - %123 = and i64 %121, -5 - store i64 %123, ptr %43, align 4 - %124 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.i.2, ptr %124, align 1 - %125 = load i64, ptr %39, align 4 - %126 = and i64 %125, 8 - %.not214 = icmp eq i64 %126, 0 - br i1 %.not214, label %__barray_check_bounds.exit221.i.i.3, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.3: ; preds = %loop_body.i180.2 - %127 = or disjoint i64 %125, 8 - store i64 %127, ptr %39, align 4 - %128 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %128) - %129 = load i64, ptr %39, align 4 - %130 = and i64 %129, 8 - %.not215 = icmp eq i64 %130, 0 - br i1 %.not215, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.3 - -__barray_check_bounds.exit.i.3: ; preds = %__barray_check_bounds.exit221.i.i.3 - %131 = and i64 %129, -9 - store i64 %131, ptr %39, align 4 - store i64 %128, ptr %74, align 4 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %128) - tail call void @___dec_future_refcount(i64 %128) - %132 = load i64, ptr %43, align 4 - %133 = and i64 %132, 8 - %.not216 = icmp eq i64 %133, 0 - br i1 %.not216, label %panic.i.i179, label %loop_body.i180.3 - -loop_body.i180.3: ; preds = %__barray_check_bounds.exit.i.3 - %134 = and i64 %132, -9 - store i64 %134, ptr %43, align 4 - %135 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.i.3, ptr %135, align 1 - %136 = load i64, ptr %39, align 4 - %137 = trunc i64 %136 to i1 - br i1 %137, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %138 = load i64, ptr %43, align 4 - %139 = and i64 %138, 15 - store i64 %139, ptr %43, align 4 - %140 = icmp eq i64 %139, 0 - br i1 %140, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit191, label %mask_block_err.i190 - -mask_block_err.i190: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit191: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-unknown-linux-gnu.ll index 56d5dff8..af06889d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-unknown-linux-gnu.ll @@ -5,511 +5,516 @@ target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.383.exit.2, %__hugr__.__tk2_helios_qalloc.383.exit.1, %__hugr__.__tk2_helios_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.305.exit.2, %__hugr__.__tk2_helios_qalloc.305.exit.1, %__hugr__.__tk2_helios_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.1 -__hugr__.__tk2_helios_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not205 = icmp eq i64 %6, 0 - br i1 %.not205, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.2 -__hugr__.__tk2_helios_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not206 = icmp eq i64 %10, 0 - br i1 %.not206, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not207 = icmp eq i64 %14, 0 - br i1 %.not207, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not194 = icmp eq i64 %29, 0 - br i1 %.not194, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not195 = icmp eq i64 %32, 0 - br i1 %.not195, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not196 = icmp eq i64 %36, 0 - br i1 %.not196, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread -panic.i177: ; preds = %__barray_mask_borrow.exit176 +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i189, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not197 = icmp eq i64 %52, 0 - br i1 %.not197, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not198 = icmp eq i64 %60, 0 - br i1 %.not198, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not199 = icmp eq i64 %68, 0 - br i1 %.not199, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i189: ; preds = %loop_body.i180.2, %loop_body.i180.1, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %__barray_check_bounds.exit.i, label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i.3, %__barray_check_bounds.exit221.i.i.2, %__barray_check_bounds.exit221.i.i.1, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -mask_block_err.i.i.i184: ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.i180.3 - %82 = or disjoint i64 %136, 1 - store i64 %82, ptr %39, align 4 - %83 = load i64, ptr %38, align 4 - tail call void @___dec_future_refcount(i64 %83) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i - -cond_exit_433.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.i180.3 - %84 = phi i64 [ %.pre, %__barray_mask_borrow.exit228.i.i ], [ %136, %loop_body.i180.3 ] - %85 = and i64 %84, 2 - %.not217 = icmp eq i64 %85, 0 - br i1 %.not217, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i - %86 = or disjoint i64 %84, 2 - store i64 %86, ptr %39, align 4 - %87 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %87) - %.pre202 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %88 = phi i64 [ %.pre202, %__barray_mask_borrow.exit228.1.i.i ], [ %84, %cond_exit_433.thread.i.i ] - %89 = and i64 %88, 4 - %.not218 = icmp eq i64 %89, 0 - br i1 %.not218, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %90 = or disjoint i64 %88, 4 - store i64 %90, ptr %39, align 4 - %91 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %91) - %.pre203 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %92 = phi i64 [ %.pre203, %__barray_mask_borrow.exit228.2.i.i ], [ %88, %cond_exit_433.thread.1.i.i ] - %93 = and i64 %92, 8 - %.not219 = icmp eq i64 %93, 0 - br i1 %.not219, label %__barray_mask_borrow.exit228.3.i.i, label %mask_block_ok.i.i.i181.preheader - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %94 = or disjoint i64 %92, 8 - store i64 %94, ptr %39, align 4 - %95 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %95) - %.pre204 = load i64, ptr %39, align 4 - br label %mask_block_ok.i.i.i181.preheader - -mask_block_ok.i.i.i181.preheader: ; preds = %cond_exit_433.thread.2.i.i, %__barray_mask_borrow.exit228.3.i.i - %96 = phi i64 [ %.pre204, %__barray_mask_borrow.exit228.3.i.i ], [ %92, %cond_exit_433.thread.2.i.i ] - %97 = or i64 %96, -16 - store i64 %97, ptr %39, align 4 - %98 = icmp eq i64 %97, -1 - br i1 %98, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i184 - -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit221.i.i - %99 = and i64 %80, -2 - store i64 %99, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %100 = load i64, ptr %43, align 4 - %101 = trunc i64 %100 to i1 - br i1 %101, label %loop_body.i180, label %panic.i.i179 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.i.3, %__barray_check_bounds.exit.i.2, %__barray_check_bounds.exit.i.1, %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i180: ; preds = %__barray_check_bounds.exit.i - %102 = and i64 %100, -2 - store i64 %102, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %103 = load i64, ptr %39, align 4 - %104 = and i64 %103, 2 - %.not208 = icmp eq i64 %104, 0 - br i1 %.not208, label %__barray_check_bounds.exit221.i.i.1, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.1: ; preds = %loop_body.i180 - %105 = or disjoint i64 %103, 2 - store i64 %105, ptr %39, align 4 - %106 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %106) - %107 = load i64, ptr %39, align 4 - %108 = and i64 %107, 2 - %.not209 = icmp eq i64 %108, 0 - br i1 %.not209, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.1 - -__barray_check_bounds.exit.i.1: ; preds = %__barray_check_bounds.exit221.i.i.1 - %109 = and i64 %107, -3 - store i64 %109, ptr %39, align 4 - store i64 %106, ptr %58, align 4 - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %106) - tail call void @___dec_future_refcount(i64 %106) - %110 = load i64, ptr %43, align 4 - %111 = and i64 %110, 2 - %.not210 = icmp eq i64 %111, 0 - br i1 %.not210, label %panic.i.i179, label %loop_body.i180.1 - -loop_body.i180.1: ; preds = %__barray_check_bounds.exit.i.1 - %112 = and i64 %110, -3 - store i64 %112, ptr %43, align 4 - %113 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.i.1, ptr %113, align 1 - %114 = load i64, ptr %39, align 4 - %115 = and i64 %114, 4 - %.not211 = icmp eq i64 %115, 0 - br i1 %.not211, label %__barray_check_bounds.exit221.i.i.2, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.2: ; preds = %loop_body.i180.1 - %116 = or disjoint i64 %114, 4 - store i64 %116, ptr %39, align 4 - %117 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %117) - %118 = load i64, ptr %39, align 4 - %119 = and i64 %118, 4 - %.not212 = icmp eq i64 %119, 0 - br i1 %.not212, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.2 - -__barray_check_bounds.exit.i.2: ; preds = %__barray_check_bounds.exit221.i.i.2 - %120 = and i64 %118, -5 - store i64 %120, ptr %39, align 4 - store i64 %117, ptr %66, align 4 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %117) - tail call void @___dec_future_refcount(i64 %117) - %121 = load i64, ptr %43, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_356 + +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not213 = icmp eq i64 %122, 0 - br i1 %.not213, label %panic.i.i179, label %loop_body.i180.2 - -loop_body.i180.2: ; preds = %__barray_check_bounds.exit.i.2 - %123 = and i64 %121, -5 - store i64 %123, ptr %43, align 4 - %124 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.i.2, ptr %124, align 1 - %125 = load i64, ptr %39, align 4 - %126 = and i64 %125, 8 - %.not214 = icmp eq i64 %126, 0 - br i1 %.not214, label %__barray_check_bounds.exit221.i.i.3, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.3: ; preds = %loop_body.i180.2 - %127 = or disjoint i64 %125, 8 - store i64 %127, ptr %39, align 4 - %128 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %128) - %129 = load i64, ptr %39, align 4 - %130 = and i64 %129, 8 - %.not215 = icmp eq i64 %130, 0 - br i1 %.not215, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.3 - -__barray_check_bounds.exit.i.3: ; preds = %__barray_check_bounds.exit221.i.i.3 - %131 = and i64 %129, -9 - store i64 %131, ptr %39, align 4 - store i64 %128, ptr %74, align 4 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %128) - tail call void @___dec_future_refcount(i64 %128) - %132 = load i64, ptr %43, align 4 - %133 = and i64 %132, 8 - %.not216 = icmp eq i64 %133, 0 - br i1 %.not216, label %panic.i.i179, label %loop_body.i180.3 - -loop_body.i180.3: ; preds = %__barray_check_bounds.exit.i.3 - %134 = and i64 %132, -9 - store i64 %134, ptr %43, align 4 - %135 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.i.3, ptr %135, align 1 - %136 = load i64, ptr %39, align 4 - %137 = trunc i64 %136 to i1 - br i1 %137, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %138 = load i64, ptr %43, align 4 - %139 = and i64 %138, 15 - store i64 %139, ptr %43, align 4 - %140 = icmp eq i64 %139, 0 - br i1 %140, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit191, label %mask_block_err.i190 - -mask_block_err.i190: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit191: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-windows-gnu.ll index e33d6fe4..17b792f3 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-helios-x86_64-windows-gnu.ll @@ -5,511 +5,516 @@ target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.383.exit.2, %__hugr__.__tk2_helios_qalloc.383.exit.1, %__hugr__.__tk2_helios_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_helios_qalloc.305.exit.2, %__hugr__.__tk2_helios_qalloc.305.exit.1, %__hugr__.__tk2_helios_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.1 -__hugr__.__tk2_helios_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not205 = icmp eq i64 %6, 0 - br i1 %.not205, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_helios_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_helios_qalloc.305.exit.2 -__hugr__.__tk2_helios_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not206 = icmp eq i64 %10, 0 - br i1 %.not206, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not207 = icmp eq i64 %14, 0 - br i1 %.not207, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not194 = icmp eq i64 %29, 0 - br i1 %.not194, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not195 = icmp eq i64 %32, 0 - br i1 %.not195, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not196 = icmp eq i64 %36, 0 - br i1 %.not196, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread -panic.i177: ; preds = %__barray_mask_borrow.exit176 +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i189, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not197 = icmp eq i64 %52, 0 - br i1 %.not197, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not198 = icmp eq i64 %60, 0 - br i1 %.not198, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not199 = icmp eq i64 %68, 0 - br i1 %.not199, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i189: ; preds = %loop_body.i180.2, %loop_body.i180.1, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %__barray_check_bounds.exit.i, label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i.3, %__barray_check_bounds.exit221.i.i.2, %__barray_check_bounds.exit221.i.i.1, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -mask_block_err.i.i.i184: ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.i180.3 - %82 = or disjoint i64 %136, 1 - store i64 %82, ptr %39, align 4 - %83 = load i64, ptr %38, align 4 - tail call void @___dec_future_refcount(i64 %83) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i - -cond_exit_433.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.i180.3 - %84 = phi i64 [ %.pre, %__barray_mask_borrow.exit228.i.i ], [ %136, %loop_body.i180.3 ] - %85 = and i64 %84, 2 - %.not217 = icmp eq i64 %85, 0 - br i1 %.not217, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i - %86 = or disjoint i64 %84, 2 - store i64 %86, ptr %39, align 4 - %87 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %87) - %.pre202 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %88 = phi i64 [ %.pre202, %__barray_mask_borrow.exit228.1.i.i ], [ %84, %cond_exit_433.thread.i.i ] - %89 = and i64 %88, 4 - %.not218 = icmp eq i64 %89, 0 - br i1 %.not218, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %90 = or disjoint i64 %88, 4 - store i64 %90, ptr %39, align 4 - %91 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %91) - %.pre203 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %92 = phi i64 [ %.pre203, %__barray_mask_borrow.exit228.2.i.i ], [ %88, %cond_exit_433.thread.1.i.i ] - %93 = and i64 %92, 8 - %.not219 = icmp eq i64 %93, 0 - br i1 %.not219, label %__barray_mask_borrow.exit228.3.i.i, label %mask_block_ok.i.i.i181.preheader - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %94 = or disjoint i64 %92, 8 - store i64 %94, ptr %39, align 4 - %95 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %95) - %.pre204 = load i64, ptr %39, align 4 - br label %mask_block_ok.i.i.i181.preheader - -mask_block_ok.i.i.i181.preheader: ; preds = %cond_exit_433.thread.2.i.i, %__barray_mask_borrow.exit228.3.i.i - %96 = phi i64 [ %.pre204, %__barray_mask_borrow.exit228.3.i.i ], [ %92, %cond_exit_433.thread.2.i.i ] - %97 = or i64 %96, -16 - store i64 %97, ptr %39, align 4 - %98 = icmp eq i64 %97, -1 - br i1 %98, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i184 - -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit221.i.i - %99 = and i64 %80, -2 - store i64 %99, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %100 = load i64, ptr %43, align 4 - %101 = trunc i64 %100 to i1 - br i1 %101, label %loop_body.i180, label %panic.i.i179 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.i.3, %__barray_check_bounds.exit.i.2, %__barray_check_bounds.exit.i.1, %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i180: ; preds = %__barray_check_bounds.exit.i - %102 = and i64 %100, -2 - store i64 %102, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %103 = load i64, ptr %39, align 4 - %104 = and i64 %103, 2 - %.not208 = icmp eq i64 %104, 0 - br i1 %.not208, label %__barray_check_bounds.exit221.i.i.1, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.1: ; preds = %loop_body.i180 - %105 = or disjoint i64 %103, 2 - store i64 %105, ptr %39, align 4 - %106 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %106) - %107 = load i64, ptr %39, align 4 - %108 = and i64 %107, 2 - %.not209 = icmp eq i64 %108, 0 - br i1 %.not209, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.1 - -__barray_check_bounds.exit.i.1: ; preds = %__barray_check_bounds.exit221.i.i.1 - %109 = and i64 %107, -3 - store i64 %109, ptr %39, align 4 - store i64 %106, ptr %58, align 4 - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %106) - tail call void @___dec_future_refcount(i64 %106) - %110 = load i64, ptr %43, align 4 - %111 = and i64 %110, 2 - %.not210 = icmp eq i64 %111, 0 - br i1 %.not210, label %panic.i.i179, label %loop_body.i180.1 - -loop_body.i180.1: ; preds = %__barray_check_bounds.exit.i.1 - %112 = and i64 %110, -3 - store i64 %112, ptr %43, align 4 - %113 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.i.1, ptr %113, align 1 - %114 = load i64, ptr %39, align 4 - %115 = and i64 %114, 4 - %.not211 = icmp eq i64 %115, 0 - br i1 %.not211, label %__barray_check_bounds.exit221.i.i.2, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.2: ; preds = %loop_body.i180.1 - %116 = or disjoint i64 %114, 4 - store i64 %116, ptr %39, align 4 - %117 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %117) - %118 = load i64, ptr %39, align 4 - %119 = and i64 %118, 4 - %.not212 = icmp eq i64 %119, 0 - br i1 %.not212, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.2 - -__barray_check_bounds.exit.i.2: ; preds = %__barray_check_bounds.exit221.i.i.2 - %120 = and i64 %118, -5 - store i64 %120, ptr %39, align 4 - store i64 %117, ptr %66, align 4 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %117) - tail call void @___dec_future_refcount(i64 %117) - %121 = load i64, ptr %43, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_356 + +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not213 = icmp eq i64 %122, 0 - br i1 %.not213, label %panic.i.i179, label %loop_body.i180.2 - -loop_body.i180.2: ; preds = %__barray_check_bounds.exit.i.2 - %123 = and i64 %121, -5 - store i64 %123, ptr %43, align 4 - %124 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.i.2, ptr %124, align 1 - %125 = load i64, ptr %39, align 4 - %126 = and i64 %125, 8 - %.not214 = icmp eq i64 %126, 0 - br i1 %.not214, label %__barray_check_bounds.exit221.i.i.3, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.3: ; preds = %loop_body.i180.2 - %127 = or disjoint i64 %125, 8 - store i64 %127, ptr %39, align 4 - %128 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %128) - %129 = load i64, ptr %39, align 4 - %130 = and i64 %129, 8 - %.not215 = icmp eq i64 %130, 0 - br i1 %.not215, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.3 - -__barray_check_bounds.exit.i.3: ; preds = %__barray_check_bounds.exit221.i.i.3 - %131 = and i64 %129, -9 - store i64 %131, ptr %39, align 4 - store i64 %128, ptr %74, align 4 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %128) - tail call void @___dec_future_refcount(i64 %128) - %132 = load i64, ptr %43, align 4 - %133 = and i64 %132, 8 - %.not216 = icmp eq i64 %133, 0 - br i1 %.not216, label %panic.i.i179, label %loop_body.i180.3 - -loop_body.i180.3: ; preds = %__barray_check_bounds.exit.i.3 - %134 = and i64 %132, -9 - store i64 %134, ptr %43, align 4 - %135 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.i.3, ptr %135, align 1 - %136 = load i64, ptr %39, align 4 - %137 = trunc i64 %136 to i1 - br i1 %137, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %138 = load i64, ptr %43, align 4 - %139 = and i64 %138, 15 - store i64 %139, ptr %43, align 4 - %140 = icmp eq i64 %139, 0 - br i1 %140, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit191, label %mask_block_err.i190 - -mask_block_err.i190: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit191: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-apple-darwin.ll index 43a85089..d0e94100 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-apple-darwin.ll @@ -5,511 +5,516 @@ target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.383.exit.2, %__hugr__.__tk2_sol_qalloc.383.exit.1, %__hugr__.__tk2_sol_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.305.exit.2, %__hugr__.__tk2_sol_qalloc.305.exit.1, %__hugr__.__tk2_sol_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.1 -__hugr__.__tk2_sol_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not219 = icmp eq i64 %6, 0 - br i1 %.not219, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.2 -__hugr__.__tk2_sol_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not220 = icmp eq i64 %10, 0 - br i1 %.not220, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not221 = icmp eq i64 %14, 0 - br i1 %.not221, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not199 = icmp eq i64 %29, 0 - br i1 %.not199, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not200 = icmp eq i64 %32, 0 - br i1 %.not200, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not201 = icmp eq i64 %36, 0 - br i1 %.not201, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i177: ; preds = %__barray_mask_borrow.exit176 +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread + +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i194, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not202 = icmp eq i64 %52, 0 - br i1 %.not202, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not203 = icmp eq i64 %60, 0 - br i1 %.not203, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not204 = icmp eq i64 %68, 0 - br i1 %.not204, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i194: ; preds = %__barray_check_bounds.exit.i.3.i183, %loop_body.1.i182, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.3.i, %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %82 = and i64 %80, -2 - store i64 %82, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %83 = load i64, ptr %43, align 4 - %84 = trunc i64 %83 to i1 - br i1 %84, label %loop_body.i180, label %panic.i.i179 - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %cond_exit_433.thread.3.i.i - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %85 = load i64, ptr %43, align 4 - %86 = and i64 %85, 15 - store i64 %86, ptr %43, align 4 - %87 = icmp eq i64 %86, 0 - br i1 %87, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i189: ; preds = %cond_exit_433.thread.3.i.i +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.3.i185 - %88 = or disjoint i64 %139, 1 - store i64 %88, ptr %39, align 4 - %89 = load i64, ptr %38, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 tail call void @___dec_future_refcount(i64 %89) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i + br label %cond_exit_356 -cond_exit_433.thread.i.i: ; preds = %loop_body.3.i185, %__barray_mask_borrow.exit228.i.i - %90 = phi i64 [ %139, %loop_body.3.i185 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 %91 = and i64 %90, 2 - %.not211 = icmp eq i64 %91, 0 - br i1 %.not211, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 %92 = or disjoint i64 %90, 2 - store i64 %92, ptr %39, align 4 - %93 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %93) - %.pre216 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %94 = phi i64 [ %.pre216, %__barray_mask_borrow.exit228.1.i.i ], [ %90, %cond_exit_433.thread.i.i ] - %95 = and i64 %94, 4 - %.not212 = icmp eq i64 %95, 0 - br i1 %.not212, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %96 = or disjoint i64 %94, 4 - store i64 %96, ptr %39, align 4 - %97 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %97) - %.pre217 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %98 = phi i64 [ %.pre217, %__barray_mask_borrow.exit228.2.i.i ], [ %94, %cond_exit_433.thread.1.i.i ] - %99 = and i64 %98, 8 - %.not213 = icmp eq i64 %99, 0 - br i1 %.not213, label %__barray_mask_borrow.exit228.3.i.i, label %cond_exit_433.thread.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %100 = or disjoint i64 %98, 8 - store i64 %100, ptr %39, align 4 - %101 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %101) - %.pre218 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.3.i.i - -cond_exit_433.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_433.thread.2.i.i - %102 = phi i64 [ %.pre218, %__barray_mask_borrow.exit228.3.i.i ], [ %98, %cond_exit_433.thread.2.i.i ] - %103 = or i64 %102, -16 - store i64 %103, ptr %39, align 4 - %104 = icmp eq i64 %103, -1 - br i1 %104, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i189 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.3.i184, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i180: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - %105 = and i64 %83, -2 - store i64 %105, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %106 = load i64, ptr %39, align 4 - %107 = and i64 %106, 2 - %.not205 = icmp eq i64 %107, 0 - br i1 %.not205, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i180 - %108 = or disjoint i64 %106, 2 - store i64 %108, ptr %39, align 4 - %109 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %39, align 4 - %111 = and i64 %110, 2 - %.not206 = icmp eq i64 %111, 0 - br i1 %.not206, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %112 = and i64 %110, -3 - store i64 %112, ptr %39, align 4 - store i64 %109, ptr %58, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %43, align 4 - %114 = and i64 %113, 2 - %.not.i181 = icmp eq i64 %114, 0 - br i1 %.not.i181, label %panic.i.i179, label %loop_body.1.i182 - -loop_body.1.i182: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - %115 = and i64 %113, -3 - store i64 %115, ptr %43, align 4 - %116 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.1.i, ptr %116, align 1 - %117 = load i64, ptr %39, align 4 - %118 = and i64 %117, 4 - %.not207 = icmp eq i64 %118, 0 - br i1 %.not207, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.2.i: ; preds = %loop_body.1.i182 - %119 = or disjoint i64 %117, 4 - store i64 %119, ptr %39, align 4 - %120 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %120) - %121 = load i64, ptr %39, align 4 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not208 = icmp eq i64 %122, 0 - br i1 %.not208, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i": ; preds = %__barray_check_bounds.exit221.i.2.i - %123 = and i64 %121, -5 - store i64 %123, ptr %39, align 4 - store i64 %120, ptr %66, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %120) - tail call void @___dec_future_refcount(i64 %120) - %124 = load i64, ptr %43, align 4 - %125 = and i64 %124, 4 - %.not169.i = icmp eq i64 %125, 0 - br i1 %.not169.i, label %panic.i.i179, label %__barray_check_bounds.exit.i.3.i183 - -__barray_check_bounds.exit.i.3.i183: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - %126 = and i64 %124, -5 - store i64 %126, ptr %43, align 4 - %127 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.2.i, ptr %127, align 1 - %128 = load i64, ptr %39, align 4 - %129 = and i64 %128, 8 - %.not209 = icmp eq i64 %129, 0 - br i1 %.not209, label %__barray_check_bounds.exit221.i.3.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.3.i: ; preds = %__barray_check_bounds.exit.i.3.i183 - %130 = or disjoint i64 %128, 8 - store i64 %130, ptr %39, align 4 - %131 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %131) - %132 = load i64, ptr %39, align 4 - %133 = and i64 %132, 8 - %.not210 = icmp eq i64 %133, 0 - br i1 %.not210, label %panic.i222.i.i, label %__barray_check_bounds.exit.3.i184 - -__barray_check_bounds.exit.3.i184: ; preds = %__barray_check_bounds.exit221.i.3.i - %134 = and i64 %132, -9 - store i64 %134, ptr %39, align 4 - store i64 %131, ptr %74, align 4 - %read_bool.3.i = tail call i1 @___read_future_bool(i64 %131) - tail call void @___dec_future_refcount(i64 %131) - %135 = load i64, ptr %43, align 4 - %136 = and i64 %135, 8 - %.not170.i = icmp eq i64 %136, 0 - br i1 %.not170.i, label %panic.i.i179, label %loop_body.3.i185 - -loop_body.3.i185: ; preds = %__barray_check_bounds.exit.3.i184 - %137 = and i64 %135, -9 - store i64 %137, ptr %43, align 4 - %138 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.3.i, ptr %138, align 1 - %139 = load i64, ptr %39, align 4 - %140 = trunc i64 %139 to i1 - br i1 %140, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit196, label %mask_block_err.i195 - -mask_block_err.i195: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit196: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-unknown-linux-gnu.ll index 2b32f1f4..f1210e7b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-aarch64-unknown-linux-gnu.ll @@ -5,511 +5,516 @@ target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.383.exit.2, %__hugr__.__tk2_sol_qalloc.383.exit.1, %__hugr__.__tk2_sol_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.305.exit.2, %__hugr__.__tk2_sol_qalloc.305.exit.1, %__hugr__.__tk2_sol_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.1 -__hugr__.__tk2_sol_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not219 = icmp eq i64 %6, 0 - br i1 %.not219, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.2 -__hugr__.__tk2_sol_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not220 = icmp eq i64 %10, 0 - br i1 %.not220, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not221 = icmp eq i64 %14, 0 - br i1 %.not221, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not199 = icmp eq i64 %29, 0 - br i1 %.not199, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not200 = icmp eq i64 %32, 0 - br i1 %.not200, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not201 = icmp eq i64 %36, 0 - br i1 %.not201, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i177: ; preds = %__barray_mask_borrow.exit176 +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread + +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i194, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not202 = icmp eq i64 %52, 0 - br i1 %.not202, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not203 = icmp eq i64 %60, 0 - br i1 %.not203, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not204 = icmp eq i64 %68, 0 - br i1 %.not204, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i194: ; preds = %__barray_check_bounds.exit.i.3.i183, %loop_body.1.i182, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.3.i, %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %82 = and i64 %80, -2 - store i64 %82, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %83 = load i64, ptr %43, align 4 - %84 = trunc i64 %83 to i1 - br i1 %84, label %loop_body.i180, label %panic.i.i179 - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %cond_exit_433.thread.3.i.i - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %85 = load i64, ptr %43, align 4 - %86 = and i64 %85, 15 - store i64 %86, ptr %43, align 4 - %87 = icmp eq i64 %86, 0 - br i1 %87, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i189: ; preds = %cond_exit_433.thread.3.i.i +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.3.i185 - %88 = or disjoint i64 %139, 1 - store i64 %88, ptr %39, align 4 - %89 = load i64, ptr %38, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 tail call void @___dec_future_refcount(i64 %89) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i + br label %cond_exit_356 -cond_exit_433.thread.i.i: ; preds = %loop_body.3.i185, %__barray_mask_borrow.exit228.i.i - %90 = phi i64 [ %139, %loop_body.3.i185 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 %91 = and i64 %90, 2 - %.not211 = icmp eq i64 %91, 0 - br i1 %.not211, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 %92 = or disjoint i64 %90, 2 - store i64 %92, ptr %39, align 4 - %93 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %93) - %.pre216 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %94 = phi i64 [ %.pre216, %__barray_mask_borrow.exit228.1.i.i ], [ %90, %cond_exit_433.thread.i.i ] - %95 = and i64 %94, 4 - %.not212 = icmp eq i64 %95, 0 - br i1 %.not212, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %96 = or disjoint i64 %94, 4 - store i64 %96, ptr %39, align 4 - %97 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %97) - %.pre217 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %98 = phi i64 [ %.pre217, %__barray_mask_borrow.exit228.2.i.i ], [ %94, %cond_exit_433.thread.1.i.i ] - %99 = and i64 %98, 8 - %.not213 = icmp eq i64 %99, 0 - br i1 %.not213, label %__barray_mask_borrow.exit228.3.i.i, label %cond_exit_433.thread.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %100 = or disjoint i64 %98, 8 - store i64 %100, ptr %39, align 4 - %101 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %101) - %.pre218 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.3.i.i - -cond_exit_433.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_433.thread.2.i.i - %102 = phi i64 [ %.pre218, %__barray_mask_borrow.exit228.3.i.i ], [ %98, %cond_exit_433.thread.2.i.i ] - %103 = or i64 %102, -16 - store i64 %103, ptr %39, align 4 - %104 = icmp eq i64 %103, -1 - br i1 %104, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i189 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.3.i184, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i180: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.i" - %105 = and i64 %83, -2 - store i64 %105, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %106 = load i64, ptr %39, align 4 - %107 = and i64 %106, 2 - %.not205 = icmp eq i64 %107, 0 - br i1 %.not205, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i180 - %108 = or disjoint i64 %106, 2 - store i64 %108, ptr %39, align 4 - %109 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %39, align 4 - %111 = and i64 %110, 2 - %.not206 = icmp eq i64 %111, 0 - br i1 %.not206, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %112 = and i64 %110, -3 - store i64 %112, ptr %39, align 4 - store i64 %109, ptr %58, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %43, align 4 - %114 = and i64 %113, 2 - %.not.i181 = icmp eq i64 %114, 0 - br i1 %.not.i181, label %panic.i.i179, label %loop_body.1.i182 - -loop_body.1.i182: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.1.i" - %115 = and i64 %113, -3 - store i64 %115, ptr %43, align 4 - %116 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.1.i, ptr %116, align 1 - %117 = load i64, ptr %39, align 4 - %118 = and i64 %117, 4 - %.not207 = icmp eq i64 %118, 0 - br i1 %.not207, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.2.i: ; preds = %loop_body.1.i182 - %119 = or disjoint i64 %117, 4 - store i64 %119, ptr %39, align 4 - %120 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %120) - %121 = load i64, ptr %39, align 4 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not208 = icmp eq i64 %122, 0 - br i1 %.not208, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i": ; preds = %__barray_check_bounds.exit221.i.2.i - %123 = and i64 %121, -5 - store i64 %123, ptr %39, align 4 - store i64 %120, ptr %66, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %120) - tail call void @___dec_future_refcount(i64 %120) - %124 = load i64, ptr %43, align 4 - %125 = and i64 %124, 4 - %.not169.i = icmp eq i64 %125, 0 - br i1 %.not169.i, label %panic.i.i179, label %__barray_check_bounds.exit.i.3.i183 - -__barray_check_bounds.exit.i.3.i183: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&4.234.exit.thread.2.i" - %126 = and i64 %124, -5 - store i64 %126, ptr %43, align 4 - %127 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.2.i, ptr %127, align 1 - %128 = load i64, ptr %39, align 4 - %129 = and i64 %128, 8 - %.not209 = icmp eq i64 %129, 0 - br i1 %.not209, label %__barray_check_bounds.exit221.i.3.i, label %panic.i.i.i194 - -__barray_check_bounds.exit221.i.3.i: ; preds = %__barray_check_bounds.exit.i.3.i183 - %130 = or disjoint i64 %128, 8 - store i64 %130, ptr %39, align 4 - %131 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %131) - %132 = load i64, ptr %39, align 4 - %133 = and i64 %132, 8 - %.not210 = icmp eq i64 %133, 0 - br i1 %.not210, label %panic.i222.i.i, label %__barray_check_bounds.exit.3.i184 - -__barray_check_bounds.exit.3.i184: ; preds = %__barray_check_bounds.exit221.i.3.i - %134 = and i64 %132, -9 - store i64 %134, ptr %39, align 4 - store i64 %131, ptr %74, align 4 - %read_bool.3.i = tail call i1 @___read_future_bool(i64 %131) - tail call void @___dec_future_refcount(i64 %131) - %135 = load i64, ptr %43, align 4 - %136 = and i64 %135, 8 - %.not170.i = icmp eq i64 %136, 0 - br i1 %.not170.i, label %panic.i.i179, label %loop_body.3.i185 - -loop_body.3.i185: ; preds = %__barray_check_bounds.exit.3.i184 - %137 = and i64 %135, -9 - store i64 %137, ptr %43, align 4 - %138 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.3.i, ptr %138, align 1 - %139 = load i64, ptr %39, align 4 - %140 = trunc i64 %139 to i1 - br i1 %140, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit196, label %mask_block_err.i195 - -mask_block_err.i195: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit196: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-apple-darwin.ll index 959bfe47..19c71c6a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-apple-darwin.ll @@ -5,511 +5,516 @@ target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.383.exit.2, %__hugr__.__tk2_sol_qalloc.383.exit.1, %__hugr__.__tk2_sol_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.305.exit.2, %__hugr__.__tk2_sol_qalloc.305.exit.1, %__hugr__.__tk2_sol_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.1 -__hugr__.__tk2_sol_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not205 = icmp eq i64 %6, 0 - br i1 %.not205, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.2 -__hugr__.__tk2_sol_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not206 = icmp eq i64 %10, 0 - br i1 %.not206, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not207 = icmp eq i64 %14, 0 - br i1 %.not207, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not194 = icmp eq i64 %29, 0 - br i1 %.not194, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not195 = icmp eq i64 %32, 0 - br i1 %.not195, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not196 = icmp eq i64 %36, 0 - br i1 %.not196, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread -panic.i177: ; preds = %__barray_mask_borrow.exit176 +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i189, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not197 = icmp eq i64 %52, 0 - br i1 %.not197, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not198 = icmp eq i64 %60, 0 - br i1 %.not198, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not199 = icmp eq i64 %68, 0 - br i1 %.not199, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i189: ; preds = %loop_body.i180.2, %loop_body.i180.1, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %__barray_check_bounds.exit.i, label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i.3, %__barray_check_bounds.exit221.i.i.2, %__barray_check_bounds.exit221.i.i.1, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -mask_block_err.i.i.i184: ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.i180.3 - %82 = or disjoint i64 %136, 1 - store i64 %82, ptr %39, align 4 - %83 = load i64, ptr %38, align 4 - tail call void @___dec_future_refcount(i64 %83) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i - -cond_exit_433.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.i180.3 - %84 = phi i64 [ %.pre, %__barray_mask_borrow.exit228.i.i ], [ %136, %loop_body.i180.3 ] - %85 = and i64 %84, 2 - %.not217 = icmp eq i64 %85, 0 - br i1 %.not217, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i - %86 = or disjoint i64 %84, 2 - store i64 %86, ptr %39, align 4 - %87 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %87) - %.pre202 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %88 = phi i64 [ %.pre202, %__barray_mask_borrow.exit228.1.i.i ], [ %84, %cond_exit_433.thread.i.i ] - %89 = and i64 %88, 4 - %.not218 = icmp eq i64 %89, 0 - br i1 %.not218, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %90 = or disjoint i64 %88, 4 - store i64 %90, ptr %39, align 4 - %91 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %91) - %.pre203 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %92 = phi i64 [ %.pre203, %__barray_mask_borrow.exit228.2.i.i ], [ %88, %cond_exit_433.thread.1.i.i ] - %93 = and i64 %92, 8 - %.not219 = icmp eq i64 %93, 0 - br i1 %.not219, label %__barray_mask_borrow.exit228.3.i.i, label %mask_block_ok.i.i.i181.preheader - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %94 = or disjoint i64 %92, 8 - store i64 %94, ptr %39, align 4 - %95 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %95) - %.pre204 = load i64, ptr %39, align 4 - br label %mask_block_ok.i.i.i181.preheader - -mask_block_ok.i.i.i181.preheader: ; preds = %cond_exit_433.thread.2.i.i, %__barray_mask_borrow.exit228.3.i.i - %96 = phi i64 [ %.pre204, %__barray_mask_borrow.exit228.3.i.i ], [ %92, %cond_exit_433.thread.2.i.i ] - %97 = or i64 %96, -16 - store i64 %97, ptr %39, align 4 - %98 = icmp eq i64 %97, -1 - br i1 %98, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i184 - -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit221.i.i - %99 = and i64 %80, -2 - store i64 %99, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %100 = load i64, ptr %43, align 4 - %101 = trunc i64 %100 to i1 - br i1 %101, label %loop_body.i180, label %panic.i.i179 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.i.3, %__barray_check_bounds.exit.i.2, %__barray_check_bounds.exit.i.1, %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i180: ; preds = %__barray_check_bounds.exit.i - %102 = and i64 %100, -2 - store i64 %102, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %103 = load i64, ptr %39, align 4 - %104 = and i64 %103, 2 - %.not208 = icmp eq i64 %104, 0 - br i1 %.not208, label %__barray_check_bounds.exit221.i.i.1, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.1: ; preds = %loop_body.i180 - %105 = or disjoint i64 %103, 2 - store i64 %105, ptr %39, align 4 - %106 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %106) - %107 = load i64, ptr %39, align 4 - %108 = and i64 %107, 2 - %.not209 = icmp eq i64 %108, 0 - br i1 %.not209, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.1 - -__barray_check_bounds.exit.i.1: ; preds = %__barray_check_bounds.exit221.i.i.1 - %109 = and i64 %107, -3 - store i64 %109, ptr %39, align 4 - store i64 %106, ptr %58, align 4 - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %106) - tail call void @___dec_future_refcount(i64 %106) - %110 = load i64, ptr %43, align 4 - %111 = and i64 %110, 2 - %.not210 = icmp eq i64 %111, 0 - br i1 %.not210, label %panic.i.i179, label %loop_body.i180.1 - -loop_body.i180.1: ; preds = %__barray_check_bounds.exit.i.1 - %112 = and i64 %110, -3 - store i64 %112, ptr %43, align 4 - %113 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.i.1, ptr %113, align 1 - %114 = load i64, ptr %39, align 4 - %115 = and i64 %114, 4 - %.not211 = icmp eq i64 %115, 0 - br i1 %.not211, label %__barray_check_bounds.exit221.i.i.2, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.2: ; preds = %loop_body.i180.1 - %116 = or disjoint i64 %114, 4 - store i64 %116, ptr %39, align 4 - %117 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %117) - %118 = load i64, ptr %39, align 4 - %119 = and i64 %118, 4 - %.not212 = icmp eq i64 %119, 0 - br i1 %.not212, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.2 - -__barray_check_bounds.exit.i.2: ; preds = %__barray_check_bounds.exit221.i.i.2 - %120 = and i64 %118, -5 - store i64 %120, ptr %39, align 4 - store i64 %117, ptr %66, align 4 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %117) - tail call void @___dec_future_refcount(i64 %117) - %121 = load i64, ptr %43, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_356 + +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not213 = icmp eq i64 %122, 0 - br i1 %.not213, label %panic.i.i179, label %loop_body.i180.2 - -loop_body.i180.2: ; preds = %__barray_check_bounds.exit.i.2 - %123 = and i64 %121, -5 - store i64 %123, ptr %43, align 4 - %124 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.i.2, ptr %124, align 1 - %125 = load i64, ptr %39, align 4 - %126 = and i64 %125, 8 - %.not214 = icmp eq i64 %126, 0 - br i1 %.not214, label %__barray_check_bounds.exit221.i.i.3, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.3: ; preds = %loop_body.i180.2 - %127 = or disjoint i64 %125, 8 - store i64 %127, ptr %39, align 4 - %128 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %128) - %129 = load i64, ptr %39, align 4 - %130 = and i64 %129, 8 - %.not215 = icmp eq i64 %130, 0 - br i1 %.not215, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.3 - -__barray_check_bounds.exit.i.3: ; preds = %__barray_check_bounds.exit221.i.i.3 - %131 = and i64 %129, -9 - store i64 %131, ptr %39, align 4 - store i64 %128, ptr %74, align 4 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %128) - tail call void @___dec_future_refcount(i64 %128) - %132 = load i64, ptr %43, align 4 - %133 = and i64 %132, 8 - %.not216 = icmp eq i64 %133, 0 - br i1 %.not216, label %panic.i.i179, label %loop_body.i180.3 - -loop_body.i180.3: ; preds = %__barray_check_bounds.exit.i.3 - %134 = and i64 %132, -9 - store i64 %134, ptr %43, align 4 - %135 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.i.3, ptr %135, align 1 - %136 = load i64, ptr %39, align 4 - %137 = trunc i64 %136 to i1 - br i1 %137, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %138 = load i64, ptr %43, align 4 - %139 = and i64 %138, 15 - store i64 %139, ptr %43, align 4 - %140 = icmp eq i64 %139, 0 - br i1 %140, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit191, label %mask_block_err.i190 - -mask_block_err.i190: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit191: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-unknown-linux-gnu.ll index e2cf1675..a2ed3fd2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-unknown-linux-gnu.ll @@ -5,511 +5,516 @@ target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.383.exit.2, %__hugr__.__tk2_sol_qalloc.383.exit.1, %__hugr__.__tk2_sol_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.305.exit.2, %__hugr__.__tk2_sol_qalloc.305.exit.1, %__hugr__.__tk2_sol_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.1 -__hugr__.__tk2_sol_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not205 = icmp eq i64 %6, 0 - br i1 %.not205, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.2 -__hugr__.__tk2_sol_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not206 = icmp eq i64 %10, 0 - br i1 %.not206, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not207 = icmp eq i64 %14, 0 - br i1 %.not207, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not194 = icmp eq i64 %29, 0 - br i1 %.not194, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not195 = icmp eq i64 %32, 0 - br i1 %.not195, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not196 = icmp eq i64 %36, 0 - br i1 %.not196, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread -panic.i177: ; preds = %__barray_mask_borrow.exit176 +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i189, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not197 = icmp eq i64 %52, 0 - br i1 %.not197, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not198 = icmp eq i64 %60, 0 - br i1 %.not198, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not199 = icmp eq i64 %68, 0 - br i1 %.not199, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i189: ; preds = %loop_body.i180.2, %loop_body.i180.1, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %__barray_check_bounds.exit.i, label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i.3, %__barray_check_bounds.exit221.i.i.2, %__barray_check_bounds.exit221.i.i.1, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -mask_block_err.i.i.i184: ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.i180.3 - %82 = or disjoint i64 %136, 1 - store i64 %82, ptr %39, align 4 - %83 = load i64, ptr %38, align 4 - tail call void @___dec_future_refcount(i64 %83) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i - -cond_exit_433.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.i180.3 - %84 = phi i64 [ %.pre, %__barray_mask_borrow.exit228.i.i ], [ %136, %loop_body.i180.3 ] - %85 = and i64 %84, 2 - %.not217 = icmp eq i64 %85, 0 - br i1 %.not217, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i - %86 = or disjoint i64 %84, 2 - store i64 %86, ptr %39, align 4 - %87 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %87) - %.pre202 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %88 = phi i64 [ %.pre202, %__barray_mask_borrow.exit228.1.i.i ], [ %84, %cond_exit_433.thread.i.i ] - %89 = and i64 %88, 4 - %.not218 = icmp eq i64 %89, 0 - br i1 %.not218, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %90 = or disjoint i64 %88, 4 - store i64 %90, ptr %39, align 4 - %91 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %91) - %.pre203 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %92 = phi i64 [ %.pre203, %__barray_mask_borrow.exit228.2.i.i ], [ %88, %cond_exit_433.thread.1.i.i ] - %93 = and i64 %92, 8 - %.not219 = icmp eq i64 %93, 0 - br i1 %.not219, label %__barray_mask_borrow.exit228.3.i.i, label %mask_block_ok.i.i.i181.preheader - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %94 = or disjoint i64 %92, 8 - store i64 %94, ptr %39, align 4 - %95 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %95) - %.pre204 = load i64, ptr %39, align 4 - br label %mask_block_ok.i.i.i181.preheader - -mask_block_ok.i.i.i181.preheader: ; preds = %cond_exit_433.thread.2.i.i, %__barray_mask_borrow.exit228.3.i.i - %96 = phi i64 [ %.pre204, %__barray_mask_borrow.exit228.3.i.i ], [ %92, %cond_exit_433.thread.2.i.i ] - %97 = or i64 %96, -16 - store i64 %97, ptr %39, align 4 - %98 = icmp eq i64 %97, -1 - br i1 %98, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i184 - -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit221.i.i - %99 = and i64 %80, -2 - store i64 %99, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %100 = load i64, ptr %43, align 4 - %101 = trunc i64 %100 to i1 - br i1 %101, label %loop_body.i180, label %panic.i.i179 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.i.3, %__barray_check_bounds.exit.i.2, %__barray_check_bounds.exit.i.1, %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i180: ; preds = %__barray_check_bounds.exit.i - %102 = and i64 %100, -2 - store i64 %102, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %103 = load i64, ptr %39, align 4 - %104 = and i64 %103, 2 - %.not208 = icmp eq i64 %104, 0 - br i1 %.not208, label %__barray_check_bounds.exit221.i.i.1, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.1: ; preds = %loop_body.i180 - %105 = or disjoint i64 %103, 2 - store i64 %105, ptr %39, align 4 - %106 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %106) - %107 = load i64, ptr %39, align 4 - %108 = and i64 %107, 2 - %.not209 = icmp eq i64 %108, 0 - br i1 %.not209, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.1 - -__barray_check_bounds.exit.i.1: ; preds = %__barray_check_bounds.exit221.i.i.1 - %109 = and i64 %107, -3 - store i64 %109, ptr %39, align 4 - store i64 %106, ptr %58, align 4 - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %106) - tail call void @___dec_future_refcount(i64 %106) - %110 = load i64, ptr %43, align 4 - %111 = and i64 %110, 2 - %.not210 = icmp eq i64 %111, 0 - br i1 %.not210, label %panic.i.i179, label %loop_body.i180.1 - -loop_body.i180.1: ; preds = %__barray_check_bounds.exit.i.1 - %112 = and i64 %110, -3 - store i64 %112, ptr %43, align 4 - %113 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.i.1, ptr %113, align 1 - %114 = load i64, ptr %39, align 4 - %115 = and i64 %114, 4 - %.not211 = icmp eq i64 %115, 0 - br i1 %.not211, label %__barray_check_bounds.exit221.i.i.2, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.2: ; preds = %loop_body.i180.1 - %116 = or disjoint i64 %114, 4 - store i64 %116, ptr %39, align 4 - %117 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %117) - %118 = load i64, ptr %39, align 4 - %119 = and i64 %118, 4 - %.not212 = icmp eq i64 %119, 0 - br i1 %.not212, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.2 - -__barray_check_bounds.exit.i.2: ; preds = %__barray_check_bounds.exit221.i.i.2 - %120 = and i64 %118, -5 - store i64 %120, ptr %39, align 4 - store i64 %117, ptr %66, align 4 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %117) - tail call void @___dec_future_refcount(i64 %117) - %121 = load i64, ptr %43, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_356 + +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not213 = icmp eq i64 %122, 0 - br i1 %.not213, label %panic.i.i179, label %loop_body.i180.2 - -loop_body.i180.2: ; preds = %__barray_check_bounds.exit.i.2 - %123 = and i64 %121, -5 - store i64 %123, ptr %43, align 4 - %124 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.i.2, ptr %124, align 1 - %125 = load i64, ptr %39, align 4 - %126 = and i64 %125, 8 - %.not214 = icmp eq i64 %126, 0 - br i1 %.not214, label %__barray_check_bounds.exit221.i.i.3, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.3: ; preds = %loop_body.i180.2 - %127 = or disjoint i64 %125, 8 - store i64 %127, ptr %39, align 4 - %128 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %128) - %129 = load i64, ptr %39, align 4 - %130 = and i64 %129, 8 - %.not215 = icmp eq i64 %130, 0 - br i1 %.not215, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.3 - -__barray_check_bounds.exit.i.3: ; preds = %__barray_check_bounds.exit221.i.i.3 - %131 = and i64 %129, -9 - store i64 %131, ptr %39, align 4 - store i64 %128, ptr %74, align 4 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %128) - tail call void @___dec_future_refcount(i64 %128) - %132 = load i64, ptr %43, align 4 - %133 = and i64 %132, 8 - %.not216 = icmp eq i64 %133, 0 - br i1 %.not216, label %panic.i.i179, label %loop_body.i180.3 - -loop_body.i180.3: ; preds = %__barray_check_bounds.exit.i.3 - %134 = and i64 %132, -9 - store i64 %134, ptr %43, align 4 - %135 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.i.3, ptr %135, align 1 - %136 = load i64, ptr %39, align 4 - %137 = trunc i64 %136 to i1 - br i1 %137, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %138 = load i64, ptr %43, align 4 - %139 = and i64 %138, 15 - store i64 %139, ptr %43, align 4 - %140 = icmp eq i64 %139, 0 - br i1 %140, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit191, label %mask_block_err.i190 - -mask_block_err.i190: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit191: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-windows-gnu.ll index 2a11620c..600050ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_flip_some/flip_n4-sol-x86_64-windows-gnu.ll @@ -5,511 +5,516 @@ target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 32) + %0 = tail call ptr @heap_alloc(i64 4) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 32) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 32) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit + br i1 %not_max.not.not.i, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit -cond_410_case_0.i: ; preds = %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_310_case_0.i: ; preds = %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.383.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.305.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.383.exit.2, %__hugr__.__tk2_sol_qalloc.383.exit.1, %__hugr__.__tk2_sol_qalloc.383.exit +panic.i: ; preds = %__barray_check_bounds.exit.3, %__hugr__.__tk2_sol_qalloc.305.exit.2, %__hugr__.__tk2_sol_qalloc.305.exit.1, %__hugr__.__tk2_sol_qalloc.305.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.1 + br i1 %not_max.not.not.i.1, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.1 -__hugr__.__tk2_sol_qalloc.383.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.305.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not205 = icmp eq i64 %6, 0 - br i1 %.not205, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_410_case_0.i, label %__hugr__.__tk2_sol_qalloc.383.exit.2 + br i1 %not_max.not.not.i.2, label %cond_310_case_0.i, label %__hugr__.__tk2_sol_qalloc.305.exit.2 -__hugr__.__tk2_sol_qalloc.383.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.305.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not206 = icmp eq i64 %10, 0 - br i1 %.not206, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.383.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.305.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_410_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_310_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not207 = icmp eq i64 %14, 0 - br i1 %.not207, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %panic.i168, label %__barray_mask_borrow.exit - -panic.i168: ; preds = %cond_exit_20.3 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not904 = icmp eq i64 %18, 0 + br i1 %.not904, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = trunc i64 %21 to i1 + br i1 %22, label %panic.i833, label %__barray_mask_borrow.exit + +panic.i833: ; preds = %cond_exit_12.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.3 - %19 = or disjoint i64 %17, 1 - store i64 %19, ptr %1, align 4 - %20 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %20, double 0x400921FB54442D18, double 0.000000e+00) - %21 = load i64, ptr %1, align 4 - %22 = trunc i64 %21 to i1 - br i1 %22, label %__barray_mask_return.exit170, label %panic.i169 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.3 + %23 = or disjoint i64 %21, 1 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %24, double 0x400921FB54442D18, double 0.000000e+00) + %25 = load i64, ptr %5, align 4 + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit835, label %panic.i834 -panic.i169: ; preds = %__barray_mask_borrow.exit +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit170: ; preds = %__barray_mask_borrow.exit - %23 = and i64 %21, -2 - store i64 %23, ptr %1, align 4 - store i64 %20, ptr %0, align 4 - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 4 - %.not = icmp eq i64 %25, 0 - br i1 %.not, label %__barray_mask_borrow.exit172, label %panic.i171 +__barray_mask_return.exit835: ; preds = %__barray_mask_borrow.exit + %27 = and i64 %25, -2 + store i64 %27, ptr %5, align 4 + store i64 %24, ptr %4, align 4 + %28 = load i64, ptr %5, align 4 + %29 = and i64 %28, 4 + %.not = icmp eq i64 %29, 0 + br i1 %.not, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i171: ; preds = %__barray_mask_return.exit170 +panic.i836: ; preds = %__barray_mask_return.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit172: ; preds = %__barray_mask_return.exit170 - %26 = or disjoint i64 %24, 4 - store i64 %26, ptr %1, align 4 - %27 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) - %28 = load i64, ptr %1, align 4 - %29 = and i64 %28, 4 - %.not194 = icmp eq i64 %29, 0 - br i1 %.not194, label %panic.i173, label %__barray_mask_return.exit174 - -panic.i173: ; preds = %__barray_mask_borrow.exit172 +__barray_mask_borrow.exit837: ; preds = %__barray_mask_return.exit835 + %30 = or disjoint i64 %28, 4 + store i64 %30, ptr %5, align 4 + %31 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %31, double 0x400921FB54442D18, double 0.000000e+00) + %32 = load i64, ptr %5, align 4 + %33 = and i64 %32, 4 + %.not896 = icmp eq i64 %33, 0 + br i1 %.not896, label %panic.i838, label %__barray_mask_return.exit839 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit174: ; preds = %__barray_mask_borrow.exit172 - %30 = and i64 %28, -5 - store i64 %30, ptr %1, align 4 - store i64 %27, ptr %12, align 4 - %31 = load i64, ptr %1, align 4 - %32 = and i64 %31, 8 - %.not195 = icmp eq i64 %32, 0 - br i1 %.not195, label %__barray_mask_borrow.exit176, label %panic.i175 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %34 = and i64 %32, -5 + store i64 %34, ptr %5, align 4 + store i64 %31, ptr %16, align 4 + %35 = load i64, ptr %5, align 4 + %36 = and i64 %35, 8 + %.not897 = icmp eq i64 %36, 0 + br i1 %.not897, label %__barray_mask_borrow.exit841, label %panic.i840 -panic.i175: ; preds = %__barray_mask_return.exit174 +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit176: ; preds = %__barray_mask_return.exit174 - %33 = or disjoint i64 %31, 8 - store i64 %33, ptr %1, align 4 - %34 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) - %35 = load i64, ptr %1, align 4 - %36 = and i64 %35, 8 - %.not196 = icmp eq i64 %36, 0 - br i1 %.not196, label %panic.i177, label %__barray_mask_return.exit178 +__barray_mask_borrow.exit841: ; preds = %__barray_mask_return.exit839 + %37 = or disjoint i64 %35, 8 + store i64 %37, ptr %5, align 4 + %38 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %38, double 0x400921FB54442D18, double 0.000000e+00) + %39 = load i64, ptr %5, align 4 + %40 = and i64 %39, 8 + %.not898 = icmp eq i64 %40, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 + +panic.i842: ; preds = %__barray_mask_borrow.exit841 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit843: ; preds = %__barray_mask_borrow.exit841 + %41 = and i64 %39, -9 + store i64 %41, ptr %5, align 4 + store i64 %38, ptr %20, align 4 + %42 = load i64, ptr %5, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %panic.i850, label %.thread -panic.i177: ; preds = %__barray_mask_borrow.exit176 +panic.i846: ; preds = %.thread.3, %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit178: ; preds = %__barray_mask_borrow.exit176 - %37 = and i64 %35, -9 - store i64 %37, ptr %1, align 4 - store i64 %34, ptr %16, align 4 - %38 = tail call ptr @heap_alloc(i64 32) - %39 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %39, align 1 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$4.140.exit": ; preds = %loop_body.3.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %42 = tail call ptr @heap_alloc(i64 4) - %43 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %43, align 1 - %44 = load i64, ptr %39, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i189, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.3.i +mask_block_err.i: ; preds = %cond_exit_142.3 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.3.i, %loop_body.1.i, %loop_body.i, %__barray_mask_return.exit178 +panic.i850: ; preds = %cond_exit_142.2, %cond_exit_142.1, %cond_exit_142, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i": ; preds = %__barray_mask_return.exit178 - %46 = or disjoint i64 %40, 1 - store i64 %46, ptr %1, align 4 - %47 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %47) - tail call void @___qfree(i64 %47) - %48 = load i64, ptr %39, align 4 - %49 = trunc i64 %48 to i1 - br i1 %49, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.3.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.i" - %50 = and i64 %48, -2 - store i64 %50, ptr %39, align 4 - store i64 %lazy_measure.i, ptr %38, align 4 - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not197 = icmp eq i64 %52, 0 - br i1 %.not197, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i": ; preds = %loop_body.i - %53 = or disjoint i64 %51, 2 - store i64 %53, ptr %1, align 4 - %54 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %54) - tail call void @___qfree(i64 %54) - %55 = load i64, ptr %39, align 4 - %56 = and i64 %55, 2 - %.not.i = icmp eq i64 %56, 0 - br i1 %.not.i, label %panic.i.i, label %loop_body.1.i - -loop_body.1.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.1.i" - %57 = and i64 %55, -3 - store i64 %57, ptr %39, align 4 - %58 = getelementptr inbounds nuw i8, ptr %38, i64 8 - store i64 %lazy_measure.1.i, ptr %58, align 4 - %59 = load i64, ptr %1, align 4 - %60 = and i64 %59, 4 - %.not198 = icmp eq i64 %60, 0 - br i1 %.not198, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i": ; preds = %loop_body.1.i - %61 = or disjoint i64 %59, 4 - store i64 %61, ptr %1, align 4 - %62 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %62) +.thread: ; preds = %__barray_mask_return.exit843 + %44 = or disjoint i64 %42, 1 + store i64 %44, ptr %5, align 4 + %45 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %46 = load i64, ptr %3, align 4 + %47 = trunc i64 %46 to i1 + br i1 %47, label %cond_exit_142, label %panic.i846 + +cond_exit_142: ; preds = %.thread + %48 = and i64 %46, -2 + store i64 %48, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %49 = load i64, ptr %5, align 4 + %50 = and i64 %49, 2 + %.not920 = icmp eq i64 %50, 0 + br i1 %.not920, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_142 + %51 = or disjoint i64 %49, 2 + store i64 %51, ptr %5, align 4 + %52 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %53 = load i64, ptr %52, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %53) + tail call void @___qfree(i64 %53) + %54 = load i64, ptr %3, align 4 + %55 = and i64 %54, 2 + %.not921 = icmp eq i64 %55, 0 + br i1 %.not921, label %panic.i846, label %cond_exit_142.1 + +cond_exit_142.1: ; preds = %.thread.1 + %56 = and i64 %54, -3 + store i64 %56, ptr %3, align 4 + %57 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %57, align 4 + %58 = load i64, ptr %5, align 4 + %59 = and i64 %58, 4 + %.not922 = icmp eq i64 %59, 0 + br i1 %.not922, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_142.1 + %60 = or disjoint i64 %58, 4 + store i64 %60, ptr %5, align 4 + %61 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %62 = load i64, ptr %61, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %62) tail call void @___qfree(i64 %62) - %63 = load i64, ptr %39, align 4 + %63 = load i64, ptr %3, align 4 %64 = and i64 %63, 4 - %.not182.i = icmp eq i64 %64, 0 - br i1 %.not182.i, label %panic.i.i, label %__barray_check_bounds.exit.i.3.i + %.not923 = icmp eq i64 %64, 0 + br i1 %.not923, label %panic.i846, label %cond_exit_142.2 -__barray_check_bounds.exit.i.3.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&4.297.exit.thread.2.i" +cond_exit_142.2: ; preds = %.thread.2 %65 = and i64 %63, -5 - store i64 %65, ptr %39, align 4 - %66 = getelementptr inbounds nuw i8, ptr %38, i64 16 - store i64 %lazy_measure.2.i, ptr %66, align 4 - %67 = load i64, ptr %1, align 4 + store i64 %65, ptr %3, align 4 + %66 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %66, align 4 + %67 = load i64, ptr %5, align 4 %68 = and i64 %67, 8 - %.not199 = icmp eq i64 %68, 0 - br i1 %.not199, label %__barray_check_bounds.exit.3.i, label %panic.i.i.i + %.not924 = icmp eq i64 %68, 0 + br i1 %.not924, label %.thread.3, label %panic.i850 -__barray_check_bounds.exit.3.i: ; preds = %__barray_check_bounds.exit.i.3.i +.thread.3: ; preds = %cond_exit_142.2 %69 = or disjoint i64 %67, 8 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %16, align 4 - %lazy_measure.3.i = tail call i64 @___lazy_measure(i64 %70) - tail call void @___qfree(i64 %70) - %71 = load i64, ptr %39, align 4 - %72 = and i64 %71, 8 - %.not183.i = icmp eq i64 %72, 0 - br i1 %.not183.i, label %panic.i.i, label %loop_body.3.i - -loop_body.3.i: ; preds = %__barray_check_bounds.exit.3.i - %73 = and i64 %71, -9 - store i64 %73, ptr %39, align 4 - %74 = getelementptr inbounds nuw i8, ptr %38, i64 24 - store i64 %lazy_measure.3.i, ptr %74, align 4 - %75 = load i64, ptr %1, align 4 - %76 = or i64 %75, -16 - store i64 %76, ptr %1, align 4 - %77 = icmp eq i64 %76, -1 - br i1 %77, label %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit", label %mask_block_err.i.i.i - -panic.i.i.i189: ; preds = %loop_body.i180.2, %loop_body.i180.1, %loop_body.i180, %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" + store i64 %69, ptr %5, align 4 + %70 = getelementptr inbounds nuw i8, ptr %4, i64 24 + %71 = load i64, ptr %70, align 4 + %lazy_measure.3 = tail call i64 @___lazy_measure(i64 %71) + tail call void @___qfree(i64 %71) + %72 = load i64, ptr %3, align 4 + %73 = and i64 %72, 8 + %.not925 = icmp eq i64 %73, 0 + br i1 %.not925, label %panic.i846, label %cond_exit_142.3 + +cond_exit_142.3: ; preds = %.thread.3 + %74 = and i64 %72, -9 + store i64 %74, ptr %3, align 4 + %75 = getelementptr inbounds nuw i8, ptr %2, i64 24 + store i64 %lazy_measure.3, ptr %75, align 4 + %76 = load i64, ptr %5, align 4 + %77 = or i64 %76, -16 + store i64 %77, ptr %5, align 4 + %78 = icmp eq i64 %77, -1 + br i1 %78, label %loop_body295.preheader.preheader, label %mask_block_err.i + +loop_body295.preheader.preheader: ; preds = %cond_exit_142.3 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %79 = load i64, ptr %3, align 4 + %80 = trunc i64 %79 to i1 + br i1 %80, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.3, %cond_exit_208.1, %cond_exit_208, %loop_body295.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$4.140.exit" - %78 = or disjoint i64 %44, 1 - store i64 %78, ptr %39, align 4 - %79 = load i64, ptr %38, align 4 - tail call void @___inc_future_refcount(i64 %79) - %80 = load i64, ptr %39, align 4 - %81 = trunc i64 %80 to i1 - br i1 %81, label %__barray_check_bounds.exit.i, label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body295.preheader.preheader + %81 = or disjoint i64 %79, 1 + store i64 %81, ptr %3, align 4 + %82 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %82) + %83 = load i64, ptr %3, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_249_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i.3, %__barray_check_bounds.exit221.i.i.2, %__barray_check_bounds.exit221.i.i.1, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.3, %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -mask_block_err.i.i.i184: ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.3, %cond_249_case_1.thread.2, %cond_249_case_1.thread.1, %cond_249_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.i180.3 - %82 = or disjoint i64 %136, 1 - store i64 %82, ptr %39, align 4 - %83 = load i64, ptr %38, align 4 - tail call void @___dec_future_refcount(i64 %83) - %.pre = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.i.i - -cond_exit_433.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.i180.3 - %84 = phi i64 [ %.pre, %__barray_mask_borrow.exit228.i.i ], [ %136, %loop_body.i180.3 ] - %85 = and i64 %84, 2 - %.not217 = icmp eq i64 %85, 0 - br i1 %.not217, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_433.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_433.thread.i.i - %86 = or disjoint i64 %84, 2 - store i64 %86, ptr %39, align 4 - %87 = load i64, ptr %58, align 4 - tail call void @___dec_future_refcount(i64 %87) - %.pre202 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.1.i.i - -cond_exit_433.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_433.thread.i.i - %88 = phi i64 [ %.pre202, %__barray_mask_borrow.exit228.1.i.i ], [ %84, %cond_exit_433.thread.i.i ] - %89 = and i64 %88, 4 - %.not218 = icmp eq i64 %89, 0 - br i1 %.not218, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_433.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_433.thread.1.i.i - %90 = or disjoint i64 %88, 4 - store i64 %90, ptr %39, align 4 - %91 = load i64, ptr %66, align 4 - tail call void @___dec_future_refcount(i64 %91) - %.pre203 = load i64, ptr %39, align 4 - br label %cond_exit_433.thread.2.i.i - -cond_exit_433.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_433.thread.1.i.i - %92 = phi i64 [ %.pre203, %__barray_mask_borrow.exit228.2.i.i ], [ %88, %cond_exit_433.thread.1.i.i ] - %93 = and i64 %92, 8 - %.not219 = icmp eq i64 %93, 0 - br i1 %.not219, label %__barray_mask_borrow.exit228.3.i.i, label %mask_block_ok.i.i.i181.preheader - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_433.thread.2.i.i - %94 = or disjoint i64 %92, 8 - store i64 %94, ptr %39, align 4 - %95 = load i64, ptr %74, align 4 - tail call void @___dec_future_refcount(i64 %95) - %.pre204 = load i64, ptr %39, align 4 - br label %mask_block_ok.i.i.i181.preheader - -mask_block_ok.i.i.i181.preheader: ; preds = %cond_exit_433.thread.2.i.i, %__barray_mask_borrow.exit228.3.i.i - %96 = phi i64 [ %.pre204, %__barray_mask_borrow.exit228.3.i.i ], [ %92, %cond_exit_433.thread.2.i.i ] - %97 = or i64 %96, -16 - store i64 %97, ptr %39, align 4 - %98 = icmp eq i64 %97, -1 - br i1 %98, label %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit", label %mask_block_err.i.i.i184 - -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit221.i.i - %99 = and i64 %80, -2 - store i64 %99, ptr %39, align 4 - store i64 %79, ptr %38, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %79) - tail call void @___dec_future_refcount(i64 %79) - %100 = load i64, ptr %43, align 4 - %101 = trunc i64 %100 to i1 - br i1 %101, label %loop_body.i180, label %panic.i.i179 - -panic.i.i179: ; preds = %__barray_check_bounds.exit.i.3, %__barray_check_bounds.exit.i.2, %__barray_check_bounds.exit.i.1, %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_249_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %85 = and i64 %83, -2 + store i64 %85, ptr %3, align 4 + store i64 %82, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %82) + tail call void @___dec_future_refcount(i64 %82) + %86 = load i64, ptr %1, align 4 + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_208, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_356.3 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i180: ; preds = %__barray_check_bounds.exit.i - %102 = and i64 %100, -2 - store i64 %102, ptr %43, align 4 - store i1 %read_bool.i, ptr %42, align 1 - %103 = load i64, ptr %39, align 4 - %104 = and i64 %103, 2 - %.not208 = icmp eq i64 %104, 0 - br i1 %.not208, label %__barray_check_bounds.exit221.i.i.1, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.1: ; preds = %loop_body.i180 - %105 = or disjoint i64 %103, 2 - store i64 %105, ptr %39, align 4 - %106 = load i64, ptr %58, align 4 - tail call void @___inc_future_refcount(i64 %106) - %107 = load i64, ptr %39, align 4 - %108 = and i64 %107, 2 - %.not209 = icmp eq i64 %108, 0 - br i1 %.not209, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.1 - -__barray_check_bounds.exit.i.1: ; preds = %__barray_check_bounds.exit221.i.i.1 - %109 = and i64 %107, -3 - store i64 %109, ptr %39, align 4 - store i64 %106, ptr %58, align 4 - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %106) - tail call void @___dec_future_refcount(i64 %106) - %110 = load i64, ptr %43, align 4 - %111 = and i64 %110, 2 - %.not210 = icmp eq i64 %111, 0 - br i1 %.not210, label %panic.i.i179, label %loop_body.i180.1 - -loop_body.i180.1: ; preds = %__barray_check_bounds.exit.i.1 - %112 = and i64 %110, -3 - store i64 %112, ptr %43, align 4 - %113 = getelementptr inbounds nuw i8, ptr %42, i64 1 - store i1 %read_bool.i.1, ptr %113, align 1 - %114 = load i64, ptr %39, align 4 - %115 = and i64 %114, 4 - %.not211 = icmp eq i64 %115, 0 - br i1 %.not211, label %__barray_check_bounds.exit221.i.i.2, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.2: ; preds = %loop_body.i180.1 - %116 = or disjoint i64 %114, 4 - store i64 %116, ptr %39, align 4 - %117 = load i64, ptr %66, align 4 - tail call void @___inc_future_refcount(i64 %117) - %118 = load i64, ptr %39, align 4 - %119 = and i64 %118, 4 - %.not212 = icmp eq i64 %119, 0 - br i1 %.not212, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.2 - -__barray_check_bounds.exit.i.2: ; preds = %__barray_check_bounds.exit221.i.i.2 - %120 = and i64 %118, -5 - store i64 %120, ptr %39, align 4 - store i64 %117, ptr %66, align 4 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %117) - tail call void @___dec_future_refcount(i64 %117) - %121 = load i64, ptr %43, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_208.3 + %88 = or disjoint i64 %145, 1 + store i64 %88, ptr %3, align 4 + %89 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_356 + +cond_exit_356: ; preds = %__barray_mask_borrow.exit875, %cond_exit_208.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not926 = icmp eq i64 %91, 0 + br i1 %.not926, label %__barray_mask_borrow.exit875.1, label %cond_exit_356.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_356 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_356.1 + +cond_exit_356.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_356 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 4 + %.not927 = icmp eq i64 %96, 0 + br i1 %.not927, label %__barray_mask_borrow.exit875.2, label %cond_exit_356.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_356.1 + %97 = or disjoint i64 %95, 4 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_356.2 + +cond_exit_356.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_356.1 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 8 + %.not928 = icmp eq i64 %101, 0 + br i1 %.not928, label %__barray_mask_borrow.exit875.3, label %cond_exit_356.3 + +__barray_mask_borrow.exit875.3: ; preds = %cond_exit_356.2 + %102 = or disjoint i64 %100, 8 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_356.3 + +cond_exit_356.3: ; preds = %__barray_mask_borrow.exit875.3, %cond_exit_356.2 + %105 = load i64, ptr %3, align 4 + %106 = or i64 %105, -16 + store i64 %106, ptr %3, align 4 + %107 = icmp eq i64 %106, -1 + br i1 %107, label %loop_out294, label %mask_block_err.i867 + +cond_exit_208: ; preds = %cond_249_case_1.thread + %108 = and i64 %86, -2 + store i64 %108, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %109 = load i64, ptr %3, align 4 + %110 = and i64 %109, 2 + %.not905 = icmp eq i64 %110, 0 + br i1 %.not905, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_208 + %111 = or disjoint i64 %109, 2 + store i64 %111, ptr %3, align 4 + %112 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %113 = load i64, ptr %112, align 4 + tail call void @___inc_future_refcount(i64 %113) + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not906 = icmp eq i64 %115, 0 + br i1 %.not906, label %panic.i858, label %cond_249_case_1.thread.1 + +cond_249_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %116 = and i64 %114, -3 + store i64 %116, ptr %3, align 4 + store i64 %113, ptr %112, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %113) + tail call void @___dec_future_refcount(i64 %113) + %117 = load i64, ptr %1, align 4 + %118 = and i64 %117, 2 + %.not907 = icmp eq i64 %118, 0 + br i1 %.not907, label %panic.i862, label %cond_exit_208.1 + +cond_exit_208.1: ; preds = %cond_249_case_1.thread.1 + %119 = and i64 %117, -3 + store i64 %119, ptr %1, align 4 + %120 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %120, align 1 + %121 = load i64, ptr %3, align 4 %122 = and i64 %121, 4 - %.not213 = icmp eq i64 %122, 0 - br i1 %.not213, label %panic.i.i179, label %loop_body.i180.2 - -loop_body.i180.2: ; preds = %__barray_check_bounds.exit.i.2 - %123 = and i64 %121, -5 - store i64 %123, ptr %43, align 4 - %124 = getelementptr inbounds nuw i8, ptr %42, i64 2 - store i1 %read_bool.i.2, ptr %124, align 1 - %125 = load i64, ptr %39, align 4 - %126 = and i64 %125, 8 - %.not214 = icmp eq i64 %126, 0 - br i1 %.not214, label %__barray_check_bounds.exit221.i.i.3, label %panic.i.i.i189 - -__barray_check_bounds.exit221.i.i.3: ; preds = %loop_body.i180.2 - %127 = or disjoint i64 %125, 8 - store i64 %127, ptr %39, align 4 - %128 = load i64, ptr %74, align 4 - tail call void @___inc_future_refcount(i64 %128) - %129 = load i64, ptr %39, align 4 - %130 = and i64 %129, 8 - %.not215 = icmp eq i64 %130, 0 - br i1 %.not215, label %panic.i222.i.i, label %__barray_check_bounds.exit.i.3 - -__barray_check_bounds.exit.i.3: ; preds = %__barray_check_bounds.exit221.i.i.3 - %131 = and i64 %129, -9 - store i64 %131, ptr %39, align 4 - store i64 %128, ptr %74, align 4 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %128) - tail call void @___dec_future_refcount(i64 %128) - %132 = load i64, ptr %43, align 4 - %133 = and i64 %132, 8 - %.not216 = icmp eq i64 %133, 0 - br i1 %.not216, label %panic.i.i179, label %loop_body.i180.3 - -loop_body.i180.3: ; preds = %__barray_check_bounds.exit.i.3 - %134 = and i64 %132, -9 - store i64 %134, ptr %43, align 4 - %135 = getelementptr inbounds nuw i8, ptr %42, i64 3 - store i1 %read_bool.i.3, ptr %135, align 1 - %136 = load i64, ptr %39, align 4 - %137 = trunc i64 %136 to i1 - br i1 %137, label %cond_exit_433.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit": ; preds = %mask_block_ok.i.i.i181.preheader - tail call void @heap_free(ptr nonnull %38) - tail call void @heap_free(ptr nonnull %39) - %138 = load i64, ptr %43, align 4 - %139 = and i64 %138, 15 - store i64 %139, ptr %43, align 4 - %140 = icmp eq i64 %139, 0 - br i1 %140, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" + %.not908 = icmp eq i64 %122, 0 + br i1 %.not908, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %cond_exit_208.1 + %123 = or disjoint i64 %121, 4 + store i64 %123, ptr %3, align 4 + %124 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %125 = load i64, ptr %124, align 4 + tail call void @___inc_future_refcount(i64 %125) + %126 = load i64, ptr %3, align 4 + %127 = and i64 %126, 4 + %.not909 = icmp eq i64 %127, 0 + br i1 %.not909, label %panic.i858, label %cond_249_case_1.thread.2 + +cond_249_case_1.thread.2: ; preds = %__barray_check_bounds.exit857.2 + %128 = and i64 %126, -5 + store i64 %128, ptr %3, align 4 + store i64 %125, ptr %124, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %125) + tail call void @___dec_future_refcount(i64 %125) + %129 = load i64, ptr %1, align 4 + %130 = and i64 %129, 4 + %.not910 = icmp eq i64 %130, 0 + br i1 %.not910, label %panic.i862, label %__barray_check_bounds.exit853.3 + +__barray_check_bounds.exit853.3: ; preds = %cond_249_case_1.thread.2 + %131 = and i64 %129, -5 + store i64 %131, ptr %1, align 4 + %132 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %132, align 1 + %133 = load i64, ptr %3, align 4 + %134 = and i64 %133, 8 + %.not911 = icmp eq i64 %134, 0 + br i1 %.not911, label %__barray_check_bounds.exit857.3, label %panic.i854 + +__barray_check_bounds.exit857.3: ; preds = %__barray_check_bounds.exit853.3 + %135 = or disjoint i64 %133, 8 + store i64 %135, ptr %3, align 4 + %136 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %137 = load i64, ptr %136, align 4 + tail call void @___inc_future_refcount(i64 %137) + %138 = load i64, ptr %3, align 4 + %139 = and i64 %138, 8 + %.not912 = icmp eq i64 %139, 0 + br i1 %.not912, label %panic.i858, label %__barray_check_bounds.exit861.3 + +__barray_check_bounds.exit861.3: ; preds = %__barray_check_bounds.exit857.3 + %140 = and i64 %138, -9 + store i64 %140, ptr %3, align 4 + store i64 %137, ptr %136, align 4 + %read_bool.3 = tail call i1 @___read_future_bool(i64 %137) + tail call void @___dec_future_refcount(i64 %137) + %141 = load i64, ptr %1, align 4 + %142 = and i64 %141, 8 + %.not913 = icmp eq i64 %142, 0 + br i1 %.not913, label %panic.i862, label %cond_exit_208.3 + +cond_exit_208.3: ; preds = %__barray_check_bounds.exit861.3 + %143 = and i64 %141, -9 + store i64 %143, ptr %1, align 4 + %144 = getelementptr inbounds nuw i8, ptr %0, i64 3 + store i1 %read_bool.3, ptr %144, align 1 + %145 = load i64, ptr %3, align 4 + %146 = trunc i64 %145 to i1 + br i1 %146, label %cond_exit_356, label %__barray_mask_borrow.exit875 + +loop_out294: ; preds = %cond_exit_356.3 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %147 = load i64, ptr %1, align 4 + %148 = and i64 %147, 15 + store i64 %148, ptr %1, align 4 + %149 = icmp eq i64 %148, 0 + br i1 %149, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out294 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$4.181.exit" - %141 = tail call ptr @heap_alloc(i64 4) - %142 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %142, align 1 - %143 = load i32, ptr %42, align 1 - store i32 %143, ptr %141, align 1 - tail call void @heap_free(ptr nonnull %141) - %144 = load i64, ptr %43, align 4 - %145 = and i64 %144, 15 - store i64 %145, ptr %43, align 4 - %146 = icmp eq i64 %145, 0 - br i1 %146, label %__barray_check_none_borrowed.exit191, label %mask_block_err.i190 - -mask_block_err.i190: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out294 + %150 = tail call ptr @heap_alloc(i64 4) + %151 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %151, align 1 + %152 = load i32, ptr %0, align 1 + store i32 %152, ptr %150, align 1 + tail call void @heap_free(ptr nonnull %150) + %153 = load i64, ptr %1, align 4 + %154 = and i64 %153, 15 + store i64 %154, ptr %1, align 4 + %155 = icmp eq i64 %154, 0 + br i1 %155, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 + +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit191: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %147 = alloca [4 x i1], align 4 - store i32 0, ptr %147, align 4 + %156 = alloca [4 x i1], align 4 + store i32 0, ptr %156, align 4 store i32 4, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %42, ptr %arr_ptr, align 8 - store ptr %147, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %156, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void } @@ -521,17 +526,17 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-apple-darwin.ll index 8c07c132..71bec774 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-apple-darwin.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_helios_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_helios_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_helios_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_helios_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_helios_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"608_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"608_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"608_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rxy(i64 %23, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %23, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %23, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_611_case_0.i.i: ; preds = %cond_exit_611.thread.i.i - %70 = lshr i64 %"608_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"608_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"608_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"608_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_611_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_611_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_611.thread.i.i, %loop_body.preheader.i.i - %"608_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_611.thread.i.i ] - %91 = add nuw nsw i64 %"608_0.0239.i.i", 1 - %92 = add i64 %"608_0.0239.i.i", %"608_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_611.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"608_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_611.thread.i.i - -cond_exit_611.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_611_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_611_case_0.i.i - tail call void @heap_free(ptr %"608_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"608_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 + +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_588_case_0.i, label %__barray_check_bounds.exit +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i -cond_588_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rxy(i64 %135, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %135, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %135, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 - -panic.i456: ; preds = %__barray_check_bounds.exit455 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 + +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_550_case_0: ; preds = %cond_exit_550 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_550_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_550 + %"547_0.01285" = phi i64 [ %70, %cond_exit_550 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"547_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"547_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_550, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"547_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"547_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_550 + +cond_exit_550: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"547_0.01285", 18 + br i1 %78, label %cond_550_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_550_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-unknown-linux-gnu.ll index a93d6b7c..cdc73338 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-aarch64-unknown-linux-gnu.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_helios_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_helios_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_helios_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_helios_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_helios_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"608_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"608_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"608_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rxy(i64 %23, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %23, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %23, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_611_case_0.i.i: ; preds = %cond_exit_611.thread.i.i - %70 = lshr i64 %"608_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"608_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"608_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"608_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_611_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_611_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_611.thread.i.i, %loop_body.preheader.i.i - %"608_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_611.thread.i.i ] - %91 = add nuw nsw i64 %"608_0.0239.i.i", 1 - %92 = add i64 %"608_0.0239.i.i", %"608_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_611.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"608_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_611.thread.i.i - -cond_exit_611.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_611_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_611_case_0.i.i - tail call void @heap_free(ptr %"608_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"608_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 + +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_588_case_0.i, label %__barray_check_bounds.exit +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i -cond_588_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rxy(i64 %135, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %135, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %135, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 - -panic.i456: ; preds = %__barray_check_bounds.exit455 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 + +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_550_case_0: ; preds = %cond_exit_550 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_550_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_550 + %"547_0.01285" = phi i64 [ %70, %cond_exit_550 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"547_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"547_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_550, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"547_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"547_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_550 + +cond_exit_550: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"547_0.01285", 18 + br i1 %78, label %cond_550_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_550_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-apple-darwin.ll index 0ec9a894..7252fad1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-apple-darwin.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_helios_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_helios_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_helios_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_helios_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_helios_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"608_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"608_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"608_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rxy(i64 %23, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %23, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %23, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_611_case_0.i.i: ; preds = %cond_exit_611.thread.i.i - %70 = lshr i64 %"608_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"608_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"608_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"608_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_611_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_611_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_611.thread.i.i, %loop_body.preheader.i.i - %"608_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_611.thread.i.i ] - %91 = add nuw nsw i64 %"608_0.0239.i.i", 1 - %92 = add i64 %"608_0.0239.i.i", %"608_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_611.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"608_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_611.thread.i.i - -cond_exit_611.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_611_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_611_case_0.i.i - tail call void @heap_free(ptr %"608_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"608_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 + +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_588_case_0.i, label %__barray_check_bounds.exit +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i -cond_588_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rxy(i64 %135, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %135, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %135, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 - -panic.i456: ; preds = %__barray_check_bounds.exit455 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 + +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_550_case_0: ; preds = %cond_exit_550 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_550_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_550 + %"547_0.01285" = phi i64 [ %70, %cond_exit_550 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"547_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"547_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_550, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"547_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"547_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_550 + +cond_exit_550: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"547_0.01285", 18 + br i1 %78, label %cond_550_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_550_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-unknown-linux-gnu.ll index d06628d6..1ef881c5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-unknown-linux-gnu.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_helios_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_helios_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_helios_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_helios_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_helios_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"608_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"608_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"608_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rxy(i64 %23, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %23, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %23, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_611_case_0.i.i: ; preds = %cond_exit_611.thread.i.i - %70 = lshr i64 %"608_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"608_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"608_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"608_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_611_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_611_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_611.thread.i.i, %loop_body.preheader.i.i - %"608_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_611.thread.i.i ] - %91 = add nuw nsw i64 %"608_0.0239.i.i", 1 - %92 = add i64 %"608_0.0239.i.i", %"608_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_611.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"608_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_611.thread.i.i - -cond_exit_611.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_611_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_611_case_0.i.i - tail call void @heap_free(ptr %"608_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"608_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 + +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_588_case_0.i, label %__barray_check_bounds.exit +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i -cond_588_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rxy(i64 %135, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %135, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %135, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 - -panic.i456: ; preds = %__barray_check_bounds.exit455 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 + +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_550_case_0: ; preds = %cond_exit_550 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_550_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_550 + %"547_0.01285" = phi i64 [ %70, %cond_exit_550 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"547_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"547_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_550, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"547_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"547_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_550 + +cond_exit_550: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"547_0.01285", 18 + br i1 %78, label %cond_550_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_550_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-windows-gnu.ll index 6815ab24..adae1b0f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-helios-x86_64-windows-gnu.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_helios_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_helios_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_helios_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_helios_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_helios_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"608_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"608_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"608_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rxy(i64 %23, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %23, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %23, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_611_case_0.i.i: ; preds = %cond_exit_611.thread.i.i - %70 = lshr i64 %"608_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"608_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"608_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"608_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_611_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_611_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_611.thread.i.i, %loop_body.preheader.i.i - %"608_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_611.thread.i.i ] - %91 = add nuw nsw i64 %"608_0.0239.i.i", 1 - %92 = add i64 %"608_0.0239.i.i", %"608_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"608_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_611.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"608_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_611.thread.i.i - -cond_exit_611.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_611_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_611_case_0.i.i - tail call void @heap_free(ptr %"608_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"608_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 + +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_588_case_0.i, label %__barray_check_bounds.exit +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i -cond_588_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rxy(i64 %135, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %135, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %135, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 - -panic.i456: ; preds = %__barray_check_bounds.exit455 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 + +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_550_case_0: ; preds = %cond_exit_550 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_550_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_550 + %"547_0.01285" = phi i64 [ %70, %cond_exit_550 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"547_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"547_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_550, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"547_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"547_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_550 + +cond_exit_550: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"547_0.01285", 18 + br i1 %78, label %cond_550_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_550_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-apple-darwin.ll index f5d0042c..f9316b44 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-apple-darwin.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_sol_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_sol_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_sol_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_sol_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_sol_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"607_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"607_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"607_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_610_case_0.i.i: ; preds = %cond_exit_610.thread.i.i - %70 = lshr i64 %"607_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"607_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"607_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"607_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_610_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_610_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_610.thread.i.i, %loop_body.preheader.i.i - %"607_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_610.thread.i.i ] - %91 = add nuw nsw i64 %"607_0.0239.i.i", 1 - %92 = add i64 %"607_0.0239.i.i", %"607_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_610.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"607_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_610.thread.i.i - -cond_exit_610.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_610_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_610_case_0.i.i - tail call void @heap_free(ptr %"607_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"607_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_587_case_0.i, label %__barray_check_bounds.exit +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_587_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %135, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 -panic.i456: ; preds = %__barray_check_bounds.exit455 +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_549_case_0: ; preds = %cond_exit_549 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_549_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_549 + %"546_0.01285" = phi i64 [ %70, %cond_exit_549 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"546_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"546_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_549, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"546_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"546_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_549 + +cond_exit_549: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"546_0.01285", 18 + br i1 %78, label %cond_549_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_549_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-unknown-linux-gnu.ll index aa560d4d..070d0ec1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-aarch64-unknown-linux-gnu.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_sol_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_sol_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_sol_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_sol_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_sol_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"607_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"607_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"607_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_610_case_0.i.i: ; preds = %cond_exit_610.thread.i.i - %70 = lshr i64 %"607_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"607_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"607_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"607_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_610_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_610_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_610.thread.i.i, %loop_body.preheader.i.i - %"607_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_610.thread.i.i ] - %91 = add nuw nsw i64 %"607_0.0239.i.i", 1 - %92 = add i64 %"607_0.0239.i.i", %"607_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_610.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"607_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_610.thread.i.i - -cond_exit_610.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_610_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_610_case_0.i.i - tail call void @heap_free(ptr %"607_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"607_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_587_case_0.i, label %__barray_check_bounds.exit +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_587_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %135, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 -panic.i456: ; preds = %__barray_check_bounds.exit455 +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_549_case_0: ; preds = %cond_exit_549 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_549_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_549 + %"546_0.01285" = phi i64 [ %70, %cond_exit_549 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"546_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"546_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_549, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"546_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"546_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_549 + +cond_exit_549: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"546_0.01285", 18 + br i1 %78, label %cond_549_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_549_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-apple-darwin.ll index 01f19e61..e0bf789a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-apple-darwin.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_sol_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_sol_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_sol_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_sol_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_sol_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"607_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"607_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"607_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_610_case_0.i.i: ; preds = %cond_exit_610.thread.i.i - %70 = lshr i64 %"607_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"607_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"607_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"607_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_610_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_610_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_610.thread.i.i, %loop_body.preheader.i.i - %"607_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_610.thread.i.i ] - %91 = add nuw nsw i64 %"607_0.0239.i.i", 1 - %92 = add i64 %"607_0.0239.i.i", %"607_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_610.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"607_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_610.thread.i.i - -cond_exit_610.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_610_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_610_case_0.i.i - tail call void @heap_free(ptr %"607_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"607_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_587_case_0.i, label %__barray_check_bounds.exit +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_587_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %135, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 -panic.i456: ; preds = %__barray_check_bounds.exit455 +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_549_case_0: ; preds = %cond_exit_549 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_549_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_549 + %"546_0.01285" = phi i64 [ %70, %cond_exit_549 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"546_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"546_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_549, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"546_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"546_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_549 + +cond_exit_549: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"546_0.01285", 18 + br i1 %78, label %cond_549_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_549_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-unknown-linux-gnu.ll index 0ed03136..50c543a0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-unknown-linux-gnu.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_sol_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_sol_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_sol_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_sol_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_sol_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"607_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"607_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"607_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_610_case_0.i.i: ; preds = %cond_exit_610.thread.i.i - %70 = lshr i64 %"607_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"607_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"607_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"607_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_610_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_610_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_610.thread.i.i, %loop_body.preheader.i.i - %"607_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_610.thread.i.i ] - %91 = add nuw nsw i64 %"607_0.0239.i.i", 1 - %92 = add i64 %"607_0.0239.i.i", %"607_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_610.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"607_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_610.thread.i.i - -cond_exit_610.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_610_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_610_case_0.i.i - tail call void @heap_free(ptr %"607_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"607_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_587_case_0.i, label %__barray_check_bounds.exit +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_587_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %135, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 -panic.i456: ; preds = %__barray_check_bounds.exit455 +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_549_case_0: ; preds = %cond_exit_549 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_549_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_549 + %"546_0.01285" = phi i64 [ %70, %cond_exit_549 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"546_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"546_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_549, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"546_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"546_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_549 + +cond_exit_549: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"546_0.01285", 18 + br i1 %78, label %cond_549_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_549_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-windows-gnu.ll index 97ba5284..b3374a98 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_from_head-sol-x86_64-windows-gnu.ll @@ -3,425 +3,352 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_522_case_0.i, label %__hugr__.__tk2_sol_qalloc.518.exit + br i1 %not_max.not.not.i, label %cond_474_case_0.i, label %__hugr__.__tk2_sol_qalloc.470.exit -cond_522_case_0.i: ; preds = %alloca_block +cond_474_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.518.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.470.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %loop_body + +loop_body: ; preds = %cond_exit_13, %__hugr__.__tk2_sol_qalloc.470.exit + %"9_2.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %"2107.0", %cond_exit_13 ] + %"9_0.sroa.0.0" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.470.exit ], [ %7, %cond_exit_13 ] + %6 = icmp samesign ugt i64 %"9_0.sroa.0.0", 19 + %7 = add nuw nsw i64 %"9_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_13, label %cond_13_case_1 + +cond_13_case_1: ; preds = %loop_body + %8 = add i64 %"9_2.0", 1 + %qalloc.i1214 = tail call i64 @___qalloc() + %not_max.not.not.i1215 = icmp eq i64 %qalloc.i1214, -1 + br i1 %not_max.not.not.i1215, label %cond_474_case_0.i1216, label %__hugr__.__tk2_sol_qalloc.470.exit1217 + +cond_474_case_0.i1216: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable -2: ; preds = %cond_exit_80 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_133_case_0, label %cond_133_case_1 +__hugr__.__tk2_sol_qalloc.470.exit1217: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1214) + %9 = icmp ult i64 %"9_2.0", 20 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i -3: ; preds = %cond_exit_80 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_133_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_133_case_1, %3 - %"147_0215.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"147_0215.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.0.insert", ptr %1, 1 - %"147_0215.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"147_0215.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"147_0215.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"350_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"350_0.sroa.15.0178.i", 1 - %32 = add i64 %"350_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.470.exit1217 + %10 = load i64, ptr %5, align 4 + %11 = lshr i64 %10, %"9_2.0" + %12 = trunc i64 %11 to i1 + br i1 %12, label %__barray_mask_return.exit, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"350_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"350_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"350_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.336.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i424 - -loop_body.preheader.i.i: ; preds = %loop_body.i427 - %"607_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"607_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"607_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i424: ; preds = %loop_body.i427, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %111, %loop_body.i427 ] - %"309_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %55, %loop_body.i427 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.336.exit" ], [ %107, %loop_body.i427 ] - %55 = add nuw nsw i64 %"309_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"309_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i440, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i440: ; preds = %__barray_check_bounds.exit.i.i424 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %13 = shl nuw nsw i64 1, %"9_2.0" + %14 = xor i64 %10, %13 + store i64 %14, ptr %5, align 4 + %15 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.0" + store i64 %qalloc.i1214, ptr %15, align 4 + br label %cond_exit_13 + +cond_exit_13: ; preds = %loop_body, %__barray_mask_return.exit + %"2107.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"9_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 21 + br i1 %exitcond, label %__barray_check_bounds.exit1219, label %loop_body + +__barray_check_bounds.exit1219: ; preds = %cond_exit_13, %__barray_mask_return.exit1224 + %16 = phi i64 [ %28, %__barray_mask_return.exit1224 ], [ 1, %cond_exit_13 ] + %"114_0.01276" = phi i64 [ %16, %__barray_mask_return.exit1224 ], [ 0, %cond_exit_13 ] + %17 = load i64, ptr %5, align 4 + %18 = lshr i64 %17, %"114_0.01276" + %19 = trunc i64 %18 to i1 + br i1 %19, label %panic.i1220, label %__barray_check_bounds.exit1222 + +panic.i1220: ; preds = %__barray_check_bounds.exit1219 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i424 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i425, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1222: ; preds = %__barray_check_bounds.exit1219 + %20 = shl nuw nsw i64 1, %"114_0.01276" + %21 = xor i64 %17, %20 + store i64 %21, ptr %5, align 4 + %22 = getelementptr inbounds nuw i64, ptr %4, i64 %"114_0.01276" + %23 = load i64, ptr %22, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %23, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %24 = load i64, ptr %5, align 4 + %25 = lshr i64 %24, %"114_0.01276" + %26 = trunc i64 %25 to i1 + br i1 %26, label %__barray_mask_return.exit1224, label %panic.i1223 + +panic.i1223: ; preds = %__barray_check_bounds.exit1222 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_610_case_0.i.i: ; preds = %cond_exit_610.thread.i.i - %70 = lshr i64 %"607_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"607_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"607_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i429 = add i64 %"607_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i429, 6 - %80 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i429, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i430 = sub nsw i64 %79, %70 - %.not.i.i.i431 = icmp eq i64 %reass.sub.i.i.i430, -1 - br i1 %.not.i.i.i431, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -87: ; preds = %mask_block_ok.i.i.i432 - %88 = add nuw i64 %.02.i.i.i433, 1 - %exitcond.not.i.i.i436 = icmp eq i64 %.02.i.i.i433, %reass.sub.i.i.i430 - br i1 %exitcond.not.i.i.i436, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit", label %mask_block_ok.i.i.i432 - -mask_block_ok.i.i.i432: ; preds = %cond_610_case_0.i.i, %87 - %.02.i.i.i433 = phi i64 [ %88, %87 ], [ 0, %cond_610_case_0.i.i ] - %gep.i.i.i434 = getelementptr i64, ptr %71, i64 %.02.i.i.i433 - %89 = load i64, ptr %gep.i.i.i434, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i435 - -mask_block_err.i.i.i435: ; preds = %mask_block_ok.i.i.i432 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1224: ; preds = %__barray_check_bounds.exit1222 + %27 = xor i64 %24, %20 + store i64 %27, ptr %5, align 4 + store i64 %23, ptr %22, align 4 + %28 = add nuw nsw i64 %16, 1 + %exitcond1279 = icmp eq i64 %28, 21 + br i1 %exitcond1279, label %cond_exit_185, label %__barray_check_bounds.exit1219 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_610.thread.i.i, %loop_body.preheader.i.i - %"607_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_610.thread.i.i ] - %91 = add nuw nsw i64 %"607_0.0239.i.i", 1 - %92 = add i64 %"607_0.0239.i.i", %"607_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"607_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_610.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"607_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_610.thread.i.i - -cond_exit_610.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_610_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i425: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"309_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i427, label %panic.i.i426 - -panic.i.i426: ; preds = %__barray_check_bounds.exit.i425 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +cond_exit_185: ; preds = %__barray_mask_return.exit1224 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %29 = icmp eq i64 %read_uint, 2 + br i1 %29, label %30, label %cond_exit_256 + +cond_exit_256: ; preds = %cond_exit_185 + %read_uint350 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint350, 2 + br i1 %.not, label %cond_236_case_0, label %cond_236_case_1 + +30: ; preds = %cond_exit_185 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1230.preheader -loop_body.i427: ; preds = %__barray_check_bounds.exit.i425 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"309_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"309_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i428 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i428, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i424 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit": ; preds = %87, %cond_610_case_0.i.i - tail call void @heap_free(ptr %"607_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"607_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1230.preheader: ; preds = %cond_236_case_1, %30 + br label %__barray_check_bounds.exit1230 + +cond_236_case_1: ; preds = %cond_exit_256 + %31 = icmp eq i64 %read_uint350, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %31) + br label %__barray_check_bounds.exit1230.preheader + +cond_236_case_0: ; preds = %cond_exit_256 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.295.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit442, label %mask_block_err.i441 - -mask_block_err.i441: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +out_of_bounds.i1225: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_none_borrowed.exit442: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_check_bounds.exit1226: ; preds = %.thread + %32 = load i64, ptr %3, align 4 + %33 = lshr i64 %32, %"298_2.01283" + %34 = trunc i64 %33 to i1 + br i1 %34, label %cond_exit_302, label %panic.i1227 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.518.exit, %cond_exit_21 - %"16_0.sroa.0.0473" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.518.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0473", 1 - %qalloc.i449 = tail call i64 @___qalloc() - %not_max.not.not.i450 = icmp eq i64 %qalloc.i449, -1 - br i1 %not_max.not.not.i450, label %cond_587_case_0.i, label %__barray_check_bounds.exit +panic.i1227: ; preds = %__barray_check_bounds.exit1226 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_587_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") +mask_block_ok.i: ; preds = %cond_exit_302 + %35 = load i64, ptr %5, align 4 + %36 = or i64 %35, -1048576 + store i64 %36, ptr %5, align 4 + %37 = icmp eq i64 %36, -1 + br i1 %37, label %loop_body510.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i449) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0473" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +__barray_check_bounds.exit1230: ; preds = %__barray_check_bounds.exit1230.preheader, %cond_exit_302 + %"298_0.sroa.15.01284" = phi i64 [ %38, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %"298_2.01283" = phi i64 [ %46, %cond_exit_302 ], [ 0, %__barray_check_bounds.exit1230.preheader ] + %38 = add nuw nsw i64 %"298_0.sroa.15.01284", 1 + %39 = load i64, ptr %5, align 4 + %40 = lshr i64 %39, %"298_0.sroa.15.01284" + %41 = trunc i64 %40 to i1 + br i1 %41, label %panic.i1231, label %.thread -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1231: ; preds = %__barray_check_bounds.exit1230 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0473" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0473" - store i64 %qalloc.i449, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %__barray_check_bounds.exit452, label %cond_21_case_1 - -__barray_check_bounds.exit452: ; preds = %cond_exit_21, %__barray_mask_return.exit457 - %"48_0.0474" = phi i64 [ %128, %__barray_mask_return.exit457 ], [ 0, %cond_exit_21 ] - %128 = add nuw nsw i64 %"48_0.0474", 1 - %129 = load i64, ptr %1, align 4 - %130 = lshr i64 %129, %"48_0.0474" - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i453, label %__barray_check_bounds.exit455 - -panic.i453: ; preds = %__barray_check_bounds.exit452 +.thread: ; preds = %__barray_check_bounds.exit1230 + %42 = shl nuw nsw i64 1, %"298_0.sroa.15.01284" + %43 = xor i64 %39, %42 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i64, ptr %4, i64 %"298_0.sroa.15.01284" + %45 = load i64, ptr %44, align 4 + %46 = add i64 %"298_2.01283", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %45) + tail call void @___qfree(i64 %45) + %47 = icmp ult i64 %"298_2.01283", 20 + br i1 %47, label %__barray_check_bounds.exit1226, label %out_of_bounds.i1225 + +cond_exit_302: ; preds = %__barray_check_bounds.exit1226 + %48 = shl nuw nsw i64 1, %"298_2.01283" + %49 = xor i64 %32, %48 + store i64 %49, ptr %3, align 4 + %50 = getelementptr inbounds nuw i64, ptr %2, i64 %"298_2.01283" + store i64 %lazy_measure, ptr %50, align 4 + %51 = icmp samesign ugt i64 %"298_0.sroa.15.01284", 18 + br i1 %51, label %mask_block_ok.i, label %__barray_check_bounds.exit1230 + +loop_body510.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1234 + +__barray_check_bounds.exit1234: ; preds = %cond_exit_368, %loop_body510.preheader.preheader + %"364_0.sroa.15.01278" = phi i64 [ %52, %cond_exit_368 ], [ 0, %loop_body510.preheader.preheader ] + %52 = add nuw nsw i64 %"364_0.sroa.15.01278", 1 + %53 = load i64, ptr %3, align 4 + %54 = lshr i64 %53, %"364_0.sroa.15.01278" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1235, label %__barray_check_bounds.exit1238 + +panic.i1235: ; preds = %__barray_check_bounds.exit1234 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit455: ; preds = %__barray_check_bounds.exit452 - %132 = shl nuw nsw i64 1, %"48_0.0474" - %133 = xor i64 %129, %132 - store i64 %133, ptr %1, align 4 - %134 = getelementptr inbounds nuw i64, ptr %0, i64 %"48_0.0474" - %135 = load i64, ptr %134, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %135, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %135, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"48_0.0474" - %138 = trunc i64 %137 to i1 - br i1 %138, label %__barray_mask_return.exit457, label %panic.i456 +__barray_check_bounds.exit1238: ; preds = %__barray_check_bounds.exit1234 + %56 = shl nuw nsw i64 1, %"364_0.sroa.15.01278" + %57 = xor i64 %53, %56 + store i64 %57, ptr %3, align 4 + %58 = getelementptr inbounds nuw i64, ptr %2, i64 %"364_0.sroa.15.01278" + %59 = load i64, ptr %58, align 4 + tail call void @___inc_future_refcount(i64 %59) + %60 = load i64, ptr %3, align 4 + %61 = lshr i64 %60, %"364_0.sroa.15.01278" + %62 = trunc i64 %61 to i1 + br i1 %62, label %__barray_check_bounds.exit1242, label %panic.i1239 -panic.i456: ; preds = %__barray_check_bounds.exit455 +panic.i1239: ; preds = %__barray_check_bounds.exit1238 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit457: ; preds = %__barray_check_bounds.exit455 - %139 = xor i64 %136, %132 - store i64 %139, ptr %1, align 4 - store i64 %135, ptr %134, align 4 - %exitcond475.not = icmp eq i64 %128, 20 - br i1 %exitcond475.not, label %cond_exit_80, label %__barray_check_bounds.exit452 +__barray_check_bounds.exit1242: ; preds = %__barray_check_bounds.exit1238 + %63 = xor i64 %60, %56 + store i64 %63, ptr %3, align 4 + store i64 %59, ptr %58, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %59) + tail call void @___dec_future_refcount(i64 %59) + %64 = load i64, ptr %1, align 4 + %65 = lshr i64 %64, %"364_0.sroa.15.01278" + %66 = trunc i64 %65 to i1 + br i1 %66, label %cond_exit_368, label %panic.i1243 + +panic.i1243: ; preds = %__barray_check_bounds.exit1242 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -cond_exit_80: ; preds = %__barray_mask_return.exit457 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i458 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %140 = icmp eq i64 %read_uint.i458, 2 - br i1 %140, label %3, label %2 +cond_549_case_0: ; preds = %cond_exit_549 + %67 = load i64, ptr %3, align 4 + %68 = or i64 %67, -1048576 + store i64 %68, ptr %3, align 4 + %69 = icmp eq i64 %68, -1 + br i1 %69, label %loop_out509, label %mask_block_err.i1248 -cond_133_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +mask_block_err.i1248: ; preds = %cond_549_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1252: ; preds = %cond_exit_368, %cond_exit_549 + %"546_0.01285" = phi i64 [ %70, %cond_exit_549 ], [ 0, %cond_exit_368 ] + %70 = add nuw nsw i64 %"546_0.01285", 1 + %71 = load i64, ptr %3, align 4 + %72 = lshr i64 %71, %"546_0.01285" + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_549, label %__barray_mask_borrow.exit1256 + +__barray_mask_borrow.exit1256: ; preds = %__barray_check_bounds.exit1252 + %74 = shl nuw nsw i64 1, %"546_0.01285" + %75 = xor i64 %71, %74 + store i64 %75, ptr %3, align 4 + %76 = getelementptr inbounds nuw i64, ptr %2, i64 %"546_0.01285" + %77 = load i64, ptr %76, align 4 + tail call void @___dec_future_refcount(i64 %77) + br label %cond_exit_549 + +cond_exit_549: ; preds = %__barray_mask_borrow.exit1256, %__barray_check_bounds.exit1252 + %78 = icmp samesign ugt i64 %"546_0.01285", 18 + br i1 %78, label %cond_549_case_0, label %__barray_check_bounds.exit1252 + +cond_exit_368: ; preds = %__barray_check_bounds.exit1242 + %79 = xor i64 %64, %56 + store i64 %79, ptr %1, align 4 + %80 = getelementptr inbounds nuw i1, ptr %0, i64 %"364_0.sroa.15.01278" + store i1 %read_bool, ptr %80, align 1 + %81 = icmp eq i64 %"364_0.sroa.15.01278", 19 + br i1 %81, label %__barray_check_bounds.exit1252, label %__barray_check_bounds.exit1234 + +loop_out509: ; preds = %cond_549_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %82 = load i64, ptr %1, align 4 + %83 = and i64 %82, 1048575 + store i64 %83, ptr %1, align 4 + %84 = icmp eq i64 %83, 0 + br i1 %84, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1257 + +mask_block_err.i1257: ; preds = %loop_out509 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out509 + %85 = tail call ptr @heap_alloc(i64 20) + %86 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %86, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %85, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %85) + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 1048575 + store i64 %88, ptr %1, align 4 + %89 = icmp eq i64 %88, 0 + br i1 %89, label %__barray_check_none_borrowed.exit1261, label %mask_block_err.i1259 + +mask_block_err.i1259: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1261: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %90 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %90, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %90, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -432,17 +359,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -453,10 +369,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-apple-darwin.ll index df76d2b4..e366a73c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-apple-darwin.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_helios_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"661_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"661_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"661_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %16, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %16, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_664_case_0.i.i: ; preds = %cond_exit_664.thread.i.i - %70 = lshr i64 %"661_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"661_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"661_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"661_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_664_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_664_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_664.thread.i.i, %loop_body.preheader.i.i - %"661_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_664.thread.i.i ] - %91 = add nuw nsw i64 %"661_0.0239.i.i", 1 - %92 = add i64 %"661_0.0239.i.i", %"661_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_664.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"661_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_664.thread.i.i - -cond_exit_664.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_664_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_664_case_0.i.i - tail call void @heap_free(ptr %"661_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"661_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %27, i64 %33, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_641_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_641_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %131, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %131, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %131, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rxy(i64 %148, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %142, i64 %148, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %148, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %148, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_566_case_0: ; preds = %cond_exit_566 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_566_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_566 + %"563_0.01331" = phi i64 [ %84, %cond_exit_566 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"563_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"563_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_566, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"563_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"563_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_566 + +cond_exit_566: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"563_0.01331", 18 + br i1 %92, label %cond_566_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_566_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-unknown-linux-gnu.ll index 1c1d3d2a..0e8e9811 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-aarch64-unknown-linux-gnu.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_helios_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"661_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"661_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"661_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %16, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %16, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_664_case_0.i.i: ; preds = %cond_exit_664.thread.i.i - %70 = lshr i64 %"661_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"661_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"661_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"661_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_664_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_664_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_664.thread.i.i, %loop_body.preheader.i.i - %"661_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_664.thread.i.i ] - %91 = add nuw nsw i64 %"661_0.0239.i.i", 1 - %92 = add i64 %"661_0.0239.i.i", %"661_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_664.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"661_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_664.thread.i.i - -cond_exit_664.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_664_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_664_case_0.i.i - tail call void @heap_free(ptr %"661_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"661_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %27, i64 %33, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_641_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_641_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %131, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %131, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %131, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rxy(i64 %148, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %142, i64 %148, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %148, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %148, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_566_case_0: ; preds = %cond_exit_566 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_566_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_566 + %"563_0.01331" = phi i64 [ %84, %cond_exit_566 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"563_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"563_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_566, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"563_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"563_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_566 + +cond_exit_566: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"563_0.01331", 18 + br i1 %92, label %cond_566_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_566_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-apple-darwin.ll index e4752361..7ee2a97e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-apple-darwin.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_helios_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"661_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"661_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"661_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %16, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %16, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_664_case_0.i.i: ; preds = %cond_exit_664.thread.i.i - %70 = lshr i64 %"661_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"661_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"661_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"661_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_664_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_664_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_664.thread.i.i, %loop_body.preheader.i.i - %"661_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_664.thread.i.i ] - %91 = add nuw nsw i64 %"661_0.0239.i.i", 1 - %92 = add i64 %"661_0.0239.i.i", %"661_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_664.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"661_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_664.thread.i.i - -cond_exit_664.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_664_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_664_case_0.i.i - tail call void @heap_free(ptr %"661_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"661_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %27, i64 %33, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_641_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_641_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %131, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %131, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %131, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rxy(i64 %148, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %142, i64 %148, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %148, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %148, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_566_case_0: ; preds = %cond_exit_566 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_566_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_566 + %"563_0.01331" = phi i64 [ %84, %cond_exit_566 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"563_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"563_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_566, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"563_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"563_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_566 + +cond_exit_566: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"563_0.01331", 18 + br i1 %92, label %cond_566_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_566_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-unknown-linux-gnu.ll index 36544c99..0a46f84e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-unknown-linux-gnu.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_helios_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"661_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"661_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"661_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %16, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %16, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_664_case_0.i.i: ; preds = %cond_exit_664.thread.i.i - %70 = lshr i64 %"661_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"661_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"661_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"661_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_664_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_664_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_664.thread.i.i, %loop_body.preheader.i.i - %"661_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_664.thread.i.i ] - %91 = add nuw nsw i64 %"661_0.0239.i.i", 1 - %92 = add i64 %"661_0.0239.i.i", %"661_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_664.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"661_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_664.thread.i.i - -cond_exit_664.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_664_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_664_case_0.i.i - tail call void @heap_free(ptr %"661_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"661_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %27, i64 %33, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_641_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_641_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %131, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %131, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %131, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rxy(i64 %148, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %142, i64 %148, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %148, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %148, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_566_case_0: ; preds = %cond_exit_566 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_566_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_566 + %"563_0.01331" = phi i64 [ %84, %cond_exit_566 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"563_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"563_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_566, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"563_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"563_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_566 + +cond_exit_566: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"563_0.01331", 18 + br i1 %92, label %cond_566_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_566_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-windows-gnu.ll index 860a2b76..a191feea 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-helios-x86_64-windows-gnu.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_helios_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"661_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"661_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"661_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %16, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %16, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_664_case_0.i.i: ; preds = %cond_exit_664.thread.i.i - %70 = lshr i64 %"661_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"661_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"661_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"661_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_664_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_664_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_664.thread.i.i, %loop_body.preheader.i.i - %"661_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_664.thread.i.i ] - %91 = add nuw nsw i64 %"661_0.0239.i.i", 1 - %92 = add i64 %"661_0.0239.i.i", %"661_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"661_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_664.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"661_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_664.thread.i.i - -cond_exit_664.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_664_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_664_case_0.i.i - tail call void @heap_free(ptr %"661_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"661_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %27, i64 %33, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_helios_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_641_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_641_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %131, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %131, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %131, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rxy(i64 %148, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %142, i64 %148, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %148, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %148, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_566_case_0: ; preds = %cond_exit_566 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_566_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_566 + %"563_0.01331" = phi i64 [ %84, %cond_exit_566 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"563_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"563_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_566, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"563_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"563_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_566 + +cond_exit_566: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"563_0.01331", 18 + br i1 %92, label %cond_566_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_566_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-apple-darwin.ll index 0ad47a64..3fff3483 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-apple-darwin.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_sol_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"659_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"659_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"659_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %16, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_662_case_0.i.i: ; preds = %cond_exit_662.thread.i.i - %70 = lshr i64 %"659_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"659_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"659_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"659_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_662_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_662_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_662.thread.i.i, %loop_body.preheader.i.i - %"659_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_662.thread.i.i ] - %91 = add nuw nsw i64 %"659_0.0239.i.i", 1 - %92 = add i64 %"659_0.0239.i.i", %"659_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_662.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"659_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_662.thread.i.i - -cond_exit_662.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_662_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_662_case_0.i.i - tail call void @heap_free(ptr %"659_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"659_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %27, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_639_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_639_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %131, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rp(i64 %142, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %142, i64 %148, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %148, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %142, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_565_case_0: ; preds = %cond_exit_565 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_565_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_565 + %"562_0.01331" = phi i64 [ %84, %cond_exit_565 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"562_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"562_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_565, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"562_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"562_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_565 + +cond_exit_565: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"562_0.01331", 18 + br i1 %92, label %cond_565_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_565_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-unknown-linux-gnu.ll index 6f2e827a..6b0817c5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-aarch64-unknown-linux-gnu.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_sol_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"659_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"659_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"659_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %16, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_662_case_0.i.i: ; preds = %cond_exit_662.thread.i.i - %70 = lshr i64 %"659_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"659_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"659_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"659_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_662_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_662_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_662.thread.i.i, %loop_body.preheader.i.i - %"659_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_662.thread.i.i ] - %91 = add nuw nsw i64 %"659_0.0239.i.i", 1 - %92 = add i64 %"659_0.0239.i.i", %"659_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_662.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"659_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_662.thread.i.i - -cond_exit_662.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_662_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_662_case_0.i.i - tail call void @heap_free(ptr %"659_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"659_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %27, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_639_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_639_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %131, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rp(i64 %142, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %142, i64 %148, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %148, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %142, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_565_case_0: ; preds = %cond_exit_565 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_565_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_565 + %"562_0.01331" = phi i64 [ %84, %cond_exit_565 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"562_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"562_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_565, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"562_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"562_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_565 + +cond_exit_565: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"562_0.01331", 18 + br i1 %92, label %cond_565_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_565_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-apple-darwin.ll index 665efa8e..30e956b4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-apple-darwin.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_sol_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"659_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"659_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"659_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %16, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_662_case_0.i.i: ; preds = %cond_exit_662.thread.i.i - %70 = lshr i64 %"659_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"659_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"659_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"659_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_662_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_662_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_662.thread.i.i, %loop_body.preheader.i.i - %"659_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_662.thread.i.i ] - %91 = add nuw nsw i64 %"659_0.0239.i.i", 1 - %92 = add i64 %"659_0.0239.i.i", %"659_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_662.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"659_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_662.thread.i.i - -cond_exit_662.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_662_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_662_case_0.i.i - tail call void @heap_free(ptr %"659_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"659_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %27, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_639_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_639_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %131, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rp(i64 %142, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %142, i64 %148, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %148, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %142, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_565_case_0: ; preds = %cond_exit_565 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_565_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_565 + %"562_0.01331" = phi i64 [ %84, %cond_exit_565 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"562_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"562_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_565, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"562_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"562_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_565 + +cond_exit_565: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"562_0.01331", 18 + br i1 %92, label %cond_565_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_565_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-unknown-linux-gnu.ll index a1a2e51b..67e378b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-unknown-linux-gnu.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_sol_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"659_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"659_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"659_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %16, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_662_case_0.i.i: ; preds = %cond_exit_662.thread.i.i - %70 = lshr i64 %"659_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"659_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"659_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"659_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_662_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_662_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_662.thread.i.i, %loop_body.preheader.i.i - %"659_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_662.thread.i.i ] - %91 = add nuw nsw i64 %"659_0.0239.i.i", 1 - %92 = add i64 %"659_0.0239.i.i", %"659_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_662.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"659_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_662.thread.i.i - -cond_exit_662.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_662_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_662_case_0.i.i - tail call void @heap_free(ptr %"659_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"659_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %27, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_639_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_639_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %131, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rp(i64 %142, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %142, i64 %148, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %148, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %142, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_565_case_0: ; preds = %cond_exit_565 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_565_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_565 + %"562_0.01331" = phi i64 [ %84, %cond_exit_565 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"562_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"562_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_565, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"562_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"562_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_565 + +cond_exit_565: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"562_0.01331", 18 + br i1 %92, label %cond_565_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_565_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-windows-gnu.ll index d80c9ca3..6ee4afeb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measure_leaked/leak_within_tail-sol-x86_64-windows-gnu.ll @@ -3,484 +3,393 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @e_Option.unw.32D4E82D.0 = private constant [43 x i8] c"*EXIT:INT:Option.unwrap: value is `Nothing`" @res_head_leake.F4F32972.0 = private constant [21 x i8] c"\14USER:INT:head_leaked" @res_head.AFE8E005.0 = private constant [15 x i8] c"\0EUSER:BOOL:head" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_tail.AD5A440E.0 = private constant [18 x i8] c"\11USER:BOOLARR:tail" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 160) + %0 = tail call ptr @heap_alloc(i64 20) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 160) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 160) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit + br i1 %not_max.not.not.i, label %cond_489_case_0.i, label %__hugr__.__tk2_sol_qalloc.485.exit -cond_557_case_0.i: ; preds = %alloca_block +cond_489_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.485.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - br label %cond_21_case_1 + br label %cond_13_case_1 -2: ; preds = %cond_exit_89 - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - br i1 %.not, label %cond_150_case_0, label %cond_150_case_1 +cond_13_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.485.exit, %cond_exit_13 + %"9_2.01321" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.485.exit ], [ %6, %cond_exit_13 ] + %6 = add nuw nsw i64 %"9_2.01321", 1 + %qalloc.i1244 = tail call i64 @___qalloc() + %not_max.not.not.i1245 = icmp eq i64 %qalloc.i1244, -1 + br i1 %not_max.not.not.i1245, label %cond_489_case_0.i1246, label %__barray_check_bounds.exit -3: ; preds = %cond_exit_89 - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) - br label %5 - -cond_150_case_1: ; preds = %2 - %4 = icmp eq i64 %read_uint.i, 1 - tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %4) - br label %5 - -5: ; preds = %cond_150_case_1, %3 - %"164_0243.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"164_0243.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.0.insert", ptr %1, 1 - %"164_0243.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"164_0243.fca.1.insert", i64 0, 2 - %6 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"164_0243.fca.2.insert", 0 - %7 = tail call ptr @heap_alloc(i64 160) - %8 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %8, align 1 - br label %__barray_check_bounds.exit.i.i - -9: ; preds = %loop_body.i - %10 = lshr i64 %.fca.2.extract.i.i, 6 - %11 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %10 - %12 = load i64, ptr %11, align 4 - %13 = and i64 %.fca.2.extract.i.i, 63 - %14 = sub nuw nsw i64 64, %13 - %15 = lshr i64 -1, %14 - %16 = icmp eq i64 %13, 0 - %17 = select i1 %16, i64 0, i64 %15 - %18 = or i64 %12, %17 - store i64 %18, ptr %11, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 19 - %19 = lshr i64 %last_valid.i.i.i, 6 - %20 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %19 - %21 = load i64, ptr %20, align 4 - %22 = and i64 %last_valid.i.i.i, 63 - %23 = shl nsw i64 -2, %22 - %24 = icmp eq i64 %22, 63 - %25 = select i1 %24, i64 0, i64 %23 - %26 = or i64 %21, %25 - store i64 %26, ptr %20, align 4 - %reass.sub.i.i.i = sub nsw i64 %19, %10 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -27: ; preds = %mask_block_ok.i.i.i - %28 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %9, %27 - %.02.i.i.i = phi i64 [ %28, %27 ], [ 0, %9 ] - %gep.i.i.i = getelementptr i64, ptr %11, i64 %.02.i.i.i - %29 = load i64, ptr %gep.i.i.i, align 4 - %30 = icmp eq i64 %29, -1 - br i1 %30, label %27, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +cond_489_case_0.i1246: ; preds = %cond_13_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %5 - %.fca.2.extract.i181.i = phi i64 [ 0, %5 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %5 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %5 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"384_0.sroa.15.0178.i" = phi i64 [ 0, %5 ], [ %31, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %6, %5 ], [ %46, %loop_body.i ] - %31 = add nuw nsw i64 %"384_0.sroa.15.0178.i", 1 - %32 = add i64 %"384_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %33 = lshr i64 %32, 6 - %34 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %33 - %35 = load i64, ptr %34, align 4 - %36 = and i64 %32, 63 - %37 = lshr i64 %35, %36 - %38 = trunc i64 %37 to i1 - br i1 %38, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit: ; preds = %cond_13_case_1 + tail call void @___reset(i64 %qalloc.i1244) + %7 = load i64, ptr %5, align 4 + %8 = lshr i64 %7, %"9_2.01321" + %9 = trunc i64 %8 to i1 + br i1 %9, label %cond_exit_13, label %panic.i -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %39 = shl nuw i64 1, %36 - %40 = xor i64 %39, %35 - store i64 %40, ptr %34, align 4 - %41 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %32 - %42 = load i64, ptr %41, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %42) - tail call void @___qfree(i64 %42) - %43 = load i64, ptr %8, align 4 - %44 = lshr i64 %43, %"384_0.sroa.15.0178.i" - %45 = trunc i64 %44 to i1 - br i1 %45, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %46 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %31, 1 - %47 = shl nuw nsw i64 1, %"384_0.sroa.15.0178.i" - %48 = xor i64 %43, %47 - store i64 %48, ptr %8, align 4 - %49 = getelementptr inbounds nuw i64, ptr %7, i64 %"384_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %49, align 4 - %50 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %50, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %50, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %50, 2 - %exitcond.not.i = icmp eq i64 %31, 20 - br i1 %exitcond.not.i, label %9, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$20.370.exit": ; preds = %27, %9 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %7, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %8, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %51 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %52 = tail call ptr @heap_alloc(i64 20) - %53 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %53, align 1 - br label %__barray_check_bounds.exit.i.i454 - -loop_body.preheader.i.i: ; preds = %loop_body.i457 - %"659_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 2 - %"659_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 1 - %"659_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %111, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i454: ; preds = %loop_body.i457, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" - %54 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %111, %loop_body.i457 ] - %"343_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %55, %loop_body.i457 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %51, %"__hugr__.guppylang.std.quantum.measure_array$20.370.exit" ], [ %107, %loop_body.i457 ] - %55 = add nuw nsw i64 %"343_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %54, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %54, 1 - %56 = add i64 %.fca.2.extract208.i.i, %"343_0.sroa.15.0168.i" - %57 = lshr i64 %56, 6 - %58 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %57 - %59 = load i64, ptr %58, align 4 - %60 = and i64 %56, 63 - %61 = lshr i64 %59, %60 - %62 = trunc i64 %61 to i1 - br i1 %62, label %panic.i.i.i470, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i470: ; preds = %__barray_check_bounds.exit.i.i454 +cond_exit_13: ; preds = %__barray_check_bounds.exit + %10 = shl nuw nsw i64 1, %"9_2.01321" + %11 = xor i64 %7, %10 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i64, ptr %4, i64 %"9_2.01321" + store i64 %qalloc.i1244, ptr %12, align 4 + %exitcond = icmp eq i64 %6, 20 + br i1 %exitcond, label %loop_out, label %cond_13_case_1 + +loop_out: ; preds = %cond_exit_13 + %13 = load i64, ptr %5, align 4 + %14 = trunc i64 %13 to i1 + br i1 %14, label %panic.i1248, label %__barray_mask_borrow.exit + +panic.i1248: ; preds = %loop_out tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i454 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %54, 0 - %63 = shl nuw i64 1, %60 - %64 = xor i64 %63, %59 - store i64 %64, ptr %58, align 4 - %65 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %56 - %66 = load i64, ptr %65, align 4 - tail call void @___inc_future_refcount(i64 %66) - %67 = load i64, ptr %58, align 4 - %68 = lshr i64 %67, %60 - %69 = trunc i64 %68 to i1 - br i1 %69, label %__barray_check_bounds.exit.i455, label %panic.i222.i.i +__barray_mask_borrow.exit: ; preds = %loop_out + %15 = or disjoint i64 %13, 1 + store i64 %15, ptr %5, align 4 + %16 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i, i64 %16, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %16, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) + %17 = load i64, ptr %5, align 4 + %18 = trunc i64 %17 to i1 + br i1 %18, label %__barray_mask_return.exit1250, label %panic.i1249 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1249: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_662_case_0.i.i: ; preds = %cond_exit_662.thread.i.i - %70 = lshr i64 %"659_1.sroa.10.0.i.i", 6 - %71 = getelementptr i64, ptr %"659_1.sroa.5.0.i.i", i64 %70 - %72 = load i64, ptr %71, align 4 - %73 = and i64 %"659_1.sroa.10.0.i.i", 63 - %74 = sub nuw nsw i64 64, %73 - %75 = lshr i64 -1, %74 - %76 = icmp eq i64 %73, 0 - %77 = select i1 %76, i64 0, i64 %75 - %78 = or i64 %72, %77 - store i64 %78, ptr %71, align 4 - %last_valid.i.i.i459 = add i64 %"659_1.sroa.10.0.i.i", 19 - %79 = lshr i64 %last_valid.i.i.i459, 6 - %80 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %79 - %81 = load i64, ptr %80, align 4 - %82 = and i64 %last_valid.i.i.i459, 63 - %83 = shl nsw i64 -2, %82 - %84 = icmp eq i64 %82, 63 - %85 = select i1 %84, i64 0, i64 %83 - %86 = or i64 %81, %85 - store i64 %86, ptr %80, align 4 - %reass.sub.i.i.i460 = sub nsw i64 %79, %70 - %.not.i.i.i461 = icmp eq i64 %reass.sub.i.i.i460, -1 - br i1 %.not.i.i.i461, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -87: ; preds = %mask_block_ok.i.i.i462 - %88 = add nuw i64 %.02.i.i.i463, 1 - %exitcond.not.i.i.i466 = icmp eq i64 %.02.i.i.i463, %reass.sub.i.i.i460 - br i1 %exitcond.not.i.i.i466, label %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit", label %mask_block_ok.i.i.i462 - -mask_block_ok.i.i.i462: ; preds = %cond_662_case_0.i.i, %87 - %.02.i.i.i463 = phi i64 [ %88, %87 ], [ 0, %cond_662_case_0.i.i ] - %gep.i.i.i464 = getelementptr i64, ptr %71, i64 %.02.i.i.i463 - %89 = load i64, ptr %gep.i.i.i464, align 4 - %90 = icmp eq i64 %89, -1 - br i1 %90, label %87, label %mask_block_err.i.i.i465 - -mask_block_err.i.i.i465: ; preds = %mask_block_ok.i.i.i462 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit1250: ; preds = %__barray_mask_borrow.exit + %19 = and i64 %17, -2 + store i64 %19, ptr %5, align 4 + store i64 %16, ptr %4, align 4 + br label %__barray_check_bounds.exit1252 + +__barray_check_bounds.exit1252: ; preds = %__barray_mask_return.exit1250, %__barray_mask_return.exit1268 + %20 = phi i64 [ 1, %__barray_mask_return.exit1250 ], [ %42, %__barray_mask_return.exit1268 ] + %"118_0.01322" = phi i64 [ 0, %__barray_mask_return.exit1250 ], [ %20, %__barray_mask_return.exit1268 ] + %21 = load i64, ptr %5, align 4 + %22 = lshr i64 %21, %"118_0.01322" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1253, label %__barray_check_bounds.exit1256 + +panic.i1253: ; preds = %__barray_check_bounds.exit1252 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_662.thread.i.i, %loop_body.preheader.i.i - %"659_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %91, %cond_exit_662.thread.i.i ] - %91 = add nuw nsw i64 %"659_0.0239.i.i", 1 - %92 = add i64 %"659_0.0239.i.i", %"659_1.sroa.10.0.i.i" - %93 = lshr i64 %92, 6 - %94 = getelementptr inbounds nuw i64, ptr %"659_1.sroa.5.0.i.i", i64 %93 - %95 = load i64, ptr %94, align 4 - %96 = and i64 %92, 63 - %97 = lshr i64 %95, %96 - %98 = trunc i64 %97 to i1 - br i1 %98, label %cond_exit_662.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %99 = shl nuw i64 1, %96 - %100 = xor i64 %99, %95 - store i64 %100, ptr %94, align 4 - %101 = getelementptr inbounds i64, ptr %"659_1.sroa.0.0.i.i", i64 %92 - %102 = load i64, ptr %101, align 4 - tail call void @___dec_future_refcount(i64 %102) - br label %cond_exit_662.thread.i.i - -cond_exit_662.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %91, 20 - br i1 %exitcond.i.i, label %cond_662_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i455: ; preds = %__barray_check_bounds.exit221.i.i - %103 = xor i64 %67, %63 - store i64 %103, ptr %58, align 4 - store i64 %66, ptr %65, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %66) - tail call void @___dec_future_refcount(i64 %66) - %104 = load i64, ptr %53, align 4 - %105 = lshr i64 %104, %"343_0.sroa.15.0168.i" - %106 = trunc i64 %105 to i1 - br i1 %106, label %loop_body.i457, label %panic.i.i456 - -panic.i.i456: ; preds = %__barray_check_bounds.exit.i455 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +__barray_check_bounds.exit1256: ; preds = %__barray_check_bounds.exit1252 + %24 = shl nuw nsw i64 1, %"118_0.01322" + %25 = xor i64 %21, %24 + store i64 %25, ptr %5, align 4 + %26 = getelementptr inbounds nuw i64, ptr %4, i64 %"118_0.01322" + %27 = load i64, ptr %26, align 4 + %28 = lshr i64 %25, %20 + %29 = trunc i64 %28 to i1 + br i1 %29, label %panic.i1257, label %__barray_check_bounds.exit1262 + +panic.i1257: ; preds = %__barray_check_bounds.exit1256 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i457: ; preds = %__barray_check_bounds.exit.i455 - %107 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %55, 1 - %108 = shl nuw nsw i64 1, %"343_0.sroa.15.0168.i" - %109 = xor i64 %104, %108 - store i64 %109, ptr %53, align 4 - %110 = getelementptr inbounds nuw i1, ptr %52, i64 %"343_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %110, align 1 - %111 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i458 = icmp eq i64 %55, 20 - br i1 %exitcond.not.i458, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i454 - -"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit": ; preds = %87, %cond_662_case_0.i.i - tail call void @heap_free(ptr %"659_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"659_1.sroa.5.0.i.i") - %112 = load i64, ptr %53, align 4 - %113 = and i64 %112, 1048575 - store i64 %113, ptr %53, align 4 - %114 = icmp eq i64 %113, 0 - br i1 %114, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1262: ; preds = %__barray_check_bounds.exit1256 + %30 = shl nuw nsw i64 2, %"118_0.01322" + %31 = xor i64 %25, %30 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i64, ptr %4, i64 %20 + %33 = load i64, ptr %32, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %27, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %27, double 0xBFF921FB54442D18) + %34 = load i64, ptr %5, align 4 + %35 = lshr i64 %34, %"118_0.01322" + %36 = trunc i64 %35 to i1 + br i1 %36, label %__barray_check_bounds.exit1266, label %panic.i1263 + +panic.i1263: ; preds = %__barray_check_bounds.exit1262 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$20.329.exit" - %115 = tail call ptr @heap_alloc(i64 20) - %116 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %116, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %115, ptr noundef nonnull align 1 dereferenceable(20) %52, i64 20, i1 false) - tail call void @heap_free(ptr nonnull %115) - %117 = load i64, ptr %53, align 4 - %118 = and i64 %117, 1048575 - store i64 %118, ptr %53, align 4 - %119 = icmp eq i64 %118, 0 - br i1 %119, label %__barray_check_none_borrowed.exit472, label %mask_block_err.i471 - -mask_block_err.i471: ; preds = %__barray_check_none_borrowed.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +__barray_check_bounds.exit1266: ; preds = %__barray_check_bounds.exit1262 + %37 = xor i64 %34, %24 + store i64 %37, ptr %5, align 4 + store i64 %27, ptr %26, align 4 + %38 = load i64, ptr %5, align 4 + %39 = lshr i64 %38, %20 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit1268, label %panic.i1267 + +panic.i1267: ; preds = %__barray_check_bounds.exit1266 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_none_borrowed.exit472: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 - %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 - %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %120 = alloca [20 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %120, i8 0, i64 20, i1 false) - store i32 20, ptr %out_arr_alloca, align 8 - store i32 1, ptr %y_ptr, align 4 - store ptr %52, ptr %arr_ptr, align 8 - store ptr %120, ptr %mask_ptr, align 8 - call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) - ret void +__barray_mask_return.exit1268: ; preds = %__barray_check_bounds.exit1266 + %41 = xor i64 %38, %30 + store i64 %41, ptr %5, align 4 + store i64 %33, ptr %32, align 4 + %42 = add nuw nsw i64 %20, 1 + %exitcond1325 = icmp eq i64 %42, 20 + br i1 %exitcond1325, label %cond_exit_189, label %__barray_check_bounds.exit1252 -cond_21_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit, %cond_exit_21 - %"16_0.sroa.0.0517" = phi i64 [ 0, %__hugr__.__tk2_sol_qalloc.553.exit ], [ %121, %cond_exit_21 ] - %121 = add nuw nsw i64 %"16_0.sroa.0.0517", 1 - %qalloc.i479 = tail call i64 @___qalloc() - %not_max.not.not.i480 = icmp eq i64 %qalloc.i479, -1 - br i1 %not_max.not.not.i480, label %cond_639_case_0.i, label %__barray_check_bounds.exit +cond_exit_189: ; preds = %__barray_mask_return.exit1268 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) + tail call void @___qfree(i64 %qalloc.i) + tail call void @___inc_future_refcount(i64 %lazy_measure_leaked) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %43 = icmp eq i64 %read_uint, 2 + br i1 %43, label %44, label %cond_exit_267 + +cond_exit_267: ; preds = %cond_exit_189 + %read_uint378 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not = icmp eq i64 %read_uint378, 2 + br i1 %.not, label %cond_247_case_0, label %cond_247_case_1 + +44: ; preds = %cond_exit_189 + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + tail call void @print_int(ptr nonnull @res_head_leake.F4F32972.0, i64 20, i64 1) + br label %__barray_check_bounds.exit1274.preheader -cond_639_case_0.i: ; preds = %cond_21_case_1 - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable +__barray_check_bounds.exit1274.preheader: ; preds = %cond_247_case_1, %44 + br label %__barray_check_bounds.exit1274 -__barray_check_bounds.exit: ; preds = %cond_21_case_1 - tail call void @___reset(i64 %qalloc.i479) - %122 = load i64, ptr %1, align 4 - %123 = lshr i64 %122, %"16_0.sroa.0.0517" - %124 = trunc i64 %123 to i1 - br i1 %124, label %cond_exit_21, label %panic.i +cond_247_case_1: ; preds = %cond_exit_267 + %45 = icmp eq i64 %read_uint378, 1 + tail call void @print_bool(ptr nonnull @res_head.AFE8E005.0, i64 14, i1 %45) + br label %__barray_check_bounds.exit1274.preheader -panic.i: ; preds = %__barray_check_bounds.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_247_case_0: ; preds = %cond_exit_267 + tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) unreachable -cond_exit_21: ; preds = %__barray_check_bounds.exit - %125 = shl nuw nsw i64 1, %"16_0.sroa.0.0517" - %126 = xor i64 %122, %125 - store i64 %126, ptr %1, align 4 - %127 = getelementptr inbounds nuw i64, ptr %0, i64 %"16_0.sroa.0.0517" - store i64 %qalloc.i479, ptr %127, align 4 - %exitcond.not = icmp eq i64 %121, 20 - br i1 %exitcond.not, label %loop_out, label %cond_21_case_1 - -loop_out: ; preds = %cond_exit_21 - %128 = load i64, ptr %1, align 4 - %129 = trunc i64 %128 to i1 - br i1 %129, label %panic.i481, label %__barray_mask_borrow.exit - -panic.i481: ; preds = %loop_out - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1269: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_mask_borrow.exit: ; preds = %loop_out - %130 = or disjoint i64 %128, 1 - store i64 %130, ptr %1, align 4 - %131 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %131, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %131, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - %132 = load i64, ptr %1, align 4 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_mask_return.exit483, label %panic.i482 +__barray_check_bounds.exit1270: ; preds = %.thread + %46 = load i64, ptr %3, align 4 + %47 = lshr i64 %46, %"310_2.01329" + %48 = trunc i64 %47 to i1 + br i1 %48, label %cond_exit_314, label %panic.i1271 -panic.i482: ; preds = %__barray_mask_borrow.exit +panic.i1271: ; preds = %__barray_check_bounds.exit1270 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit483: ; preds = %__barray_mask_borrow.exit - %134 = and i64 %132, -2 - store i64 %134, ptr %1, align 4 - store i64 %131, ptr %0, align 4 - br label %__barray_check_bounds.exit485 - -__barray_check_bounds.exit485: ; preds = %__barray_mask_return.exit501, %__barray_mask_return.exit483 - %"57_0.0518" = phi i64 [ 0, %__barray_mask_return.exit483 ], [ %135, %__barray_mask_return.exit501 ] - %135 = add nuw nsw i64 %"57_0.0518", 1 - %136 = load i64, ptr %1, align 4 - %137 = lshr i64 %136, %"57_0.0518" - %138 = trunc i64 %137 to i1 - br i1 %138, label %panic.i486, label %__barray_mask_borrow.exit487 - -panic.i486: ; preds = %__barray_check_bounds.exit485 +mask_block_ok.i: ; preds = %cond_exit_314 + %49 = load i64, ptr %5, align 4 + %50 = or i64 %49, -1048576 + store i64 %50, ptr %5, align 4 + %51 = icmp eq i64 %50, -1 + br i1 %51, label %loop_body538.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1274: ; preds = %__barray_check_bounds.exit1274.preheader, %cond_exit_314 + %"310_0.sroa.15.01330" = phi i64 [ %52, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %"310_2.01329" = phi i64 [ %60, %cond_exit_314 ], [ 0, %__barray_check_bounds.exit1274.preheader ] + %52 = add nuw nsw i64 %"310_0.sroa.15.01330", 1 + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"310_0.sroa.15.01330" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1275, label %.thread + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit487: ; preds = %__barray_check_bounds.exit485 - %139 = shl nuw nsw i64 1, %"57_0.0518" - %140 = xor i64 %136, %139 - store i64 %140, ptr %1, align 4 - %141 = getelementptr inbounds nuw i64, ptr %0, i64 %"57_0.0518" - %142 = load i64, ptr %141, align 4 - %143 = lshr i64 %140, %135 - %144 = trunc i64 %143 to i1 - br i1 %144, label %panic.i490, label %__barray_check_bounds.exit495 - -panic.i490: ; preds = %__barray_mask_borrow.exit487 +.thread: ; preds = %__barray_check_bounds.exit1274 + %56 = shl nuw nsw i64 1, %"310_0.sroa.15.01330" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"310_0.sroa.15.01330" + %59 = load i64, ptr %58, align 4 + %60 = add i64 %"310_2.01329", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %59) + tail call void @___qfree(i64 %59) + %61 = icmp ult i64 %"310_2.01329", 20 + br i1 %61, label %__barray_check_bounds.exit1270, label %out_of_bounds.i1269 + +cond_exit_314: ; preds = %__barray_check_bounds.exit1270 + %62 = shl nuw nsw i64 1, %"310_2.01329" + %63 = xor i64 %46, %62 + store i64 %63, ptr %3, align 4 + %64 = getelementptr inbounds nuw i64, ptr %2, i64 %"310_2.01329" + store i64 %lazy_measure, ptr %64, align 4 + %65 = icmp samesign ugt i64 %"310_0.sroa.15.01330", 18 + br i1 %65, label %mask_block_ok.i, label %__barray_check_bounds.exit1274 + +loop_body538.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1278 + +__barray_check_bounds.exit1278: ; preds = %cond_exit_380, %loop_body538.preheader.preheader + %"376_0.sroa.15.01324" = phi i64 [ %66, %cond_exit_380 ], [ 0, %loop_body538.preheader.preheader ] + %66 = add nuw nsw i64 %"376_0.sroa.15.01324", 1 + %67 = load i64, ptr %3, align 4 + %68 = lshr i64 %67, %"376_0.sroa.15.01324" + %69 = trunc i64 %68 to i1 + br i1 %69, label %panic.i1279, label %__barray_check_bounds.exit1282 + +panic.i1279: ; preds = %__barray_check_bounds.exit1278 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit495: ; preds = %__barray_mask_borrow.exit487 - %145 = shl nuw nsw i64 2, %"57_0.0518" - %146 = xor i64 %140, %145 - store i64 %146, ptr %1, align 4 - %147 = getelementptr inbounds nuw i64, ptr %0, i64 %135 - %148 = load i64, ptr %147, align 4 - tail call void @___rp(i64 %142, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %142, i64 %148, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %148, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %142, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %142, double 0xBFF921FB54442D18) - %149 = load i64, ptr %1, align 4 - %150 = lshr i64 %149, %"57_0.0518" - %151 = trunc i64 %150 to i1 - br i1 %151, label %__barray_check_bounds.exit499, label %panic.i496 - -panic.i496: ; preds = %__barray_check_bounds.exit495 +__barray_check_bounds.exit1282: ; preds = %__barray_check_bounds.exit1278 + %70 = shl nuw nsw i64 1, %"376_0.sroa.15.01324" + %71 = xor i64 %67, %70 + store i64 %71, ptr %3, align 4 + %72 = getelementptr inbounds nuw i64, ptr %2, i64 %"376_0.sroa.15.01324" + %73 = load i64, ptr %72, align 4 + tail call void @___inc_future_refcount(i64 %73) + %74 = load i64, ptr %3, align 4 + %75 = lshr i64 %74, %"376_0.sroa.15.01324" + %76 = trunc i64 %75 to i1 + br i1 %76, label %__barray_check_bounds.exit1286, label %panic.i1283 + +panic.i1283: ; preds = %__barray_check_bounds.exit1282 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit499: ; preds = %__barray_check_bounds.exit495 - %152 = xor i64 %149, %139 - store i64 %152, ptr %1, align 4 - store i64 %142, ptr %141, align 4 - %153 = load i64, ptr %1, align 4 - %154 = lshr i64 %153, %135 - %155 = trunc i64 %154 to i1 - br i1 %155, label %__barray_mask_return.exit501, label %panic.i500 - -panic.i500: ; preds = %__barray_check_bounds.exit499 +__barray_check_bounds.exit1286: ; preds = %__barray_check_bounds.exit1282 + %77 = xor i64 %74, %70 + store i64 %77, ptr %3, align 4 + store i64 %73, ptr %72, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %73) + tail call void @___dec_future_refcount(i64 %73) + %78 = load i64, ptr %1, align 4 + %79 = lshr i64 %78, %"376_0.sroa.15.01324" + %80 = trunc i64 %79 to i1 + br i1 %80, label %cond_exit_380, label %panic.i1287 + +panic.i1287: ; preds = %__barray_check_bounds.exit1286 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit501: ; preds = %__barray_check_bounds.exit499 - %156 = xor i64 %153, %145 - store i64 %156, ptr %1, align 4 - store i64 %148, ptr %147, align 4 - %exitcond519.not = icmp eq i64 %135, 19 - br i1 %exitcond519.not, label %cond_exit_89, label %__barray_check_bounds.exit485 +cond_565_case_0: ; preds = %cond_exit_565 + %81 = load i64, ptr %3, align 4 + %82 = or i64 %81, -1048576 + store i64 %82, ptr %3, align 4 + %83 = icmp eq i64 %82, -1 + br i1 %83, label %loop_out537, label %mask_block_err.i1292 -cond_exit_89: ; preds = %__barray_mask_return.exit501 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i) - tail call void @___qfree(i64 %qalloc.i) - tail call void @___inc_future_refcount(i64 %lazy_measure_leaked.i) - %read_uint.i502 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %157 = icmp eq i64 %read_uint.i502, 2 - br i1 %157, label %3, label %2 +mask_block_err.i1292: ; preds = %cond_565_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable -cond_150_case_0: ; preds = %2 - tail call void @panic(i32 1001, ptr nonnull @e_Option.unw.32D4E82D.0) +__barray_check_bounds.exit1296: ; preds = %cond_exit_380, %cond_exit_565 + %"562_0.01331" = phi i64 [ %84, %cond_exit_565 ], [ 0, %cond_exit_380 ] + %84 = add nuw nsw i64 %"562_0.01331", 1 + %85 = load i64, ptr %3, align 4 + %86 = lshr i64 %85, %"562_0.01331" + %87 = trunc i64 %86 to i1 + br i1 %87, label %cond_exit_565, label %__barray_mask_borrow.exit1300 + +__barray_mask_borrow.exit1300: ; preds = %__barray_check_bounds.exit1296 + %88 = shl nuw nsw i64 1, %"562_0.01331" + %89 = xor i64 %85, %88 + store i64 %89, ptr %3, align 4 + %90 = getelementptr inbounds nuw i64, ptr %2, i64 %"562_0.01331" + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_565 + +cond_exit_565: ; preds = %__barray_mask_borrow.exit1300, %__barray_check_bounds.exit1296 + %92 = icmp samesign ugt i64 %"562_0.01331", 18 + br i1 %92, label %cond_565_case_0, label %__barray_check_bounds.exit1296 + +cond_exit_380: ; preds = %__barray_check_bounds.exit1286 + %93 = xor i64 %78, %70 + store i64 %93, ptr %1, align 4 + %94 = getelementptr inbounds nuw i1, ptr %0, i64 %"376_0.sroa.15.01324" + store i1 %read_bool, ptr %94, align 1 + %95 = icmp eq i64 %"376_0.sroa.15.01324", 19 + br i1 %95, label %__barray_check_bounds.exit1296, label %__barray_check_bounds.exit1278 + +loop_out537: ; preds = %cond_565_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %96 = load i64, ptr %1, align 4 + %97 = and i64 %96, 1048575 + store i64 %97, ptr %1, align 4 + %98 = icmp eq i64 %97, 0 + br i1 %98, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1301 + +mask_block_err.i1301: ; preds = %loop_out537 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit: ; preds = %loop_out537 + %99 = tail call ptr @heap_alloc(i64 20) + %100 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %100, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %99, ptr noundef nonnull align 1 dereferenceable(20) %0, i64 20, i1 false) + tail call void @heap_free(ptr nonnull %99) + %101 = load i64, ptr %1, align 4 + %102 = and i64 %101, 1048575 + store i64 %102, ptr %1, align 4 + %103 = icmp eq i64 %102, 0 + br i1 %103, label %__barray_check_none_borrowed.exit1305, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %__barray_check_none_borrowed.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +__barray_check_none_borrowed.exit1305: ; preds = %__barray_check_none_borrowed.exit + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %104 = alloca [20 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %104, i8 0, i64 20, i1 false) + store i32 20, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %104, ptr %mask_ptr, align 8 + call void @print_bool_arr(ptr nonnull @res_tail.AD5A440E.0, i64 17, ptr nonnull %out_arr_alloca) + ret void } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -491,17 +400,6 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -declare void @print_int(ptr, i64, i64) local_unnamed_addr - -declare void @print_bool(ptr, i64, i1) local_unnamed_addr - -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - -declare void @heap_free(ptr) local_unnamed_addr - -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr @@ -512,10 +410,21 @@ declare i64 @___read_future_uint(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-apple-darwin.ll index 9061248d..631968f2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-apple-darwin.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-unknown-linux-gnu.ll index 9e149399..5946fc4a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-aarch64-unknown-linux-gnu.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-apple-darwin.ll index 367fa0dc..9fa91928 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-apple-darwin.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-unknown-linux-gnu.ll index d021553b..2ac0f83b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-unknown-linux-gnu.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-windows-gnu.ll index 17558201..47211776 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-helios-x86_64-windows-gnu.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-apple-darwin.ll index 26c9c073..dc8d9145 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-apple-darwin.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-unknown-linux-gnu.ll index be983667..d32ac253 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-aarch64-unknown-linux-gnu.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-apple-darwin.ll index da7d2417..4a13ea6a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-apple-darwin.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-unknown-linux-gnu.ll index 180a6274..bffb9df6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-unknown-linux-gnu.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-windows-gnu.ll index 8a16eb57..84ddc015 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output/measurement_output-sol-x86_64-windows-gnu.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-apple-darwin.ll index 9061248d..631968f2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-apple-darwin.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-unknown-linux-gnu.ll index 9e149399..5946fc4a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-aarch64-unknown-linux-gnu.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-apple-darwin.ll index 367fa0dc..9fa91928 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-apple-darwin.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-unknown-linux-gnu.ll index d021553b..2ac0f83b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-unknown-linux-gnu.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-windows-gnu.ll index 17558201..47211776 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-helios-x86_64-windows-gnu.ll @@ -13,110 +13,110 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_helios_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_helios_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_helios_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_helios_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.260.exit: ; preds = %__hugr__.__tk2_helios_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_helios_qalloc.274.exit +__hugr__.__tk2_helios_qalloc.273.exit380: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_helios_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.274.exit: ; preds = %__hugr__.__tk2_helios_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_helios_qalloc.288.exit +__hugr__.__tk2_helios_qalloc.273.exit384: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_helios_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.288.exit: ; preds = %__hugr__.__tk2_helios_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_helios_qalloc.273.exit388: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rxy(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rxy(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_helios_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rxy(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x400921FB54442D18) +1: ; preds = %__hugr__.__tk2_helios_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x400921FB54442D18) br label %2 2: ; preds = %0, %1 - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -128,6 +128,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -135,20 +139,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr -declare void @___rzz(i64, i64, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rzz(i64, i64, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-apple-darwin.ll index 26c9c073..dc8d9145 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-apple-darwin.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-unknown-linux-gnu.ll index be983667..d32ac253 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-aarch64-unknown-linux-gnu.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-apple-darwin.ll index da7d2417..4a13ea6a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-apple-darwin.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-unknown-linux-gnu.ll index 180a6274..bffb9df6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-unknown-linux-gnu.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-windows-gnu.ll index 8a16eb57..84ddc015 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_measurement_output_multishot/measurement_output_multishot-sol-x86_64-windows-gnu.ll @@ -13,114 +13,114 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_250_case_0.i, label %__hugr__.__tk2_sol_qalloc.246.exit + br i1 %not_max.not.not.i, label %cond_277_case_0.i, label %__hugr__.__tk2_sol_qalloc.273.exit -cond_250_case_0.i: ; preds = %alloca_block +cond_277_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.246.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.273.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i295 = tail call i64 @___qalloc() - %not_max.not.not.i296 = icmp eq i64 %qalloc.i295, -1 - br i1 %not_max.not.not.i296, label %cond_264_case_0.i, label %__hugr__.__tk2_sol_qalloc.260.exit + %qalloc.i377 = tail call i64 @___qalloc() + %not_max.not.not.i378 = icmp eq i64 %qalloc.i377, -1 + br i1 %not_max.not.not.i378, label %cond_277_case_0.i379, label %__hugr__.__tk2_sol_qalloc.273.exit380 -cond_264_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit +cond_277_case_0.i379: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.260.exit: ; preds = %__hugr__.__tk2_sol_qalloc.246.exit - tail call void @___reset(i64 %qalloc.i295) - %qalloc.i297 = tail call i64 @___qalloc() - %not_max.not.not.i298 = icmp eq i64 %qalloc.i297, -1 - br i1 %not_max.not.not.i298, label %cond_278_case_0.i, label %__hugr__.__tk2_sol_qalloc.274.exit +__hugr__.__tk2_sol_qalloc.273.exit380: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit + tail call void @___reset(i64 %qalloc.i377) + %qalloc.i381 = tail call i64 @___qalloc() + %not_max.not.not.i382 = icmp eq i64 %qalloc.i381, -1 + br i1 %not_max.not.not.i382, label %cond_277_case_0.i383, label %__hugr__.__tk2_sol_qalloc.273.exit384 -cond_278_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit +cond_277_case_0.i383: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.274.exit: ; preds = %__hugr__.__tk2_sol_qalloc.260.exit - tail call void @___reset(i64 %qalloc.i297) - %qalloc.i299 = tail call i64 @___qalloc() - %not_max.not.not.i300 = icmp eq i64 %qalloc.i299, -1 - br i1 %not_max.not.not.i300, label %cond_292_case_0.i, label %__hugr__.__tk2_sol_qalloc.288.exit +__hugr__.__tk2_sol_qalloc.273.exit384: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit380 + tail call void @___reset(i64 %qalloc.i381) + %qalloc.i385 = tail call i64 @___qalloc() + %not_max.not.not.i386 = icmp eq i64 %qalloc.i385, -1 + br i1 %not_max.not.not.i386, label %cond_277_case_0.i387, label %__hugr__.__tk2_sol_qalloc.273.exit388 -cond_292_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit +cond_277_case_0.i387: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.288.exit: ; preds = %__hugr__.__tk2_sol_qalloc.274.exit - tail call void @___reset(i64 %qalloc.i299) +__hugr__.__tk2_sol_qalloc.273.exit388: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit384 + tail call void @___reset(i64 %qalloc.i385) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rp(i64 %qalloc.i299, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) - tail call void @___rp(i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i297, double 0xBFF921FB54442D18) +0: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rp(i64 %qalloc.i385, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0xC00921FB54442D18) + tail call void @___rp(i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i381, double 0xBFF921FB54442D18) br label %2 -1: ; preds = %__hugr__.__tk2_sol_qalloc.288.exit - tail call void @___rz(i64 %qalloc.i299, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i295, double 0x400921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i295, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i295, i64 %qalloc.i297, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i297, double 0xBFF921FB54442D18, double 0.000000e+00) +1: ; preds = %__hugr__.__tk2_sol_qalloc.273.exit388 + tail call void @___rz(i64 %qalloc.i385, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i377, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i377, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i377, i64 %qalloc.i381, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i381, double 0xBFF921FB54442D18, double 0.000000e+00) br label %2 2: ; preds = %0, %1 %.sink = phi double [ 0x3FF921FB54442D18, %0 ], [ 0xBFF921FB54442D18, %1 ] - tail call void @___rp(i64 %qalloc.i295, double %.sink, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i295, double 0xBFF921FB54442D18) - %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i295) - tail call void @___qfree(i64 %qalloc.i295) + tail call void @___rp(i64 %qalloc.i377, double %.sink, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i377, double 0xBFF921FB54442D18) + %lazy_measure46 = tail call i64 @___lazy_measure(i64 %qalloc.i377) + tail call void @___qfree(i64 %qalloc.i377) %read_bool48 = tail call i1 @___read_future_bool(i64 %lazy_measure46) tail call void @___dec_future_refcount(i64 %lazy_measure46) - br i1 %read_bool48, label %cond_exit_51, label %cond_exit_78 - -cond_exit_78: ; preds = %2 - %lazy_measure_leaked.i = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_uint.i = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i) - %.not = icmp eq i64 %read_uint.i, 2 - %3 = icmp eq i64 %read_uint.i, 1 - %.294 = zext i1 %3 to i64 - %spec.select = select i1 %.not, i64 2, i64 %.294 - tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %spec.select) - %lazy_measure205 = tail call i64 @___lazy_measure(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_bool207 = tail call i1 @___read_future_bool(i64 %lazy_measure205) - tail call void @___dec_future_refcount(i64 %lazy_measure205) - tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool207) + br i1 %read_bool48, label %cond_exit_76, label %cond_exit_141 + +cond_exit_141: ; preds = %2 + %lazy_measure_leaked126 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint133 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked126) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked126) + %.not.not = icmp eq i64 %read_uint133, 2 + %3 = icmp eq i64 %read_uint133, 1 + %"250_0.0" = zext i1 %3 to i64 + %"255_0.0" = select i1 %.not.not, i64 2, i64 %"250_0.0" + tail call void @print_int(ptr nonnull @res_q2.798C5BAD.0, i64 11, i64 %"255_0.0") + %lazy_measure273 = tail call i64 @___lazy_measure(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %read_bool275 = tail call i1 @___read_future_bool(i64 %lazy_measure273) + tail call void @___dec_future_refcount(i64 %lazy_measure273) + tail call void @print_bool(ptr nonnull @res_q3.C33BF3D1.0, i64 12, i1 %read_bool275) br label %5 -cond_exit_51: ; preds = %2 - %lazy_measure59 = tail call i64 @___lazy_measure(i64 %qalloc.i297) - tail call void @___qfree(i64 %qalloc.i297) - %read_bool61 = tail call i1 @___read_future_bool(i64 %lazy_measure59) - tail call void @___dec_future_refcount(i64 %lazy_measure59) - tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool61) - %lazy_measure_leaked.i302 = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i299) - tail call void @___qfree(i64 %qalloc.i299) - %read_uint.i303 = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked.i302) - tail call void @___dec_future_refcount(i64 %lazy_measure_leaked.i302) - %.not308 = icmp eq i64 %read_uint.i303, 2 - %4 = icmp eq i64 %read_uint.i303, 1 - %. = zext i1 %4 to i64 - %spec.select306 = select i1 %.not308, i64 2, i64 %. - tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %spec.select306) +cond_exit_76: ; preds = %2 + %lazy_measure_leaked = tail call i64 @___lazy_measure_leaked(i64 %qalloc.i385) + tail call void @___qfree(i64 %qalloc.i385) + %lazy_measure60 = tail call i64 @___lazy_measure(i64 %qalloc.i381) + tail call void @___qfree(i64 %qalloc.i381) + %read_uint = tail call i64 @___read_future_uint(i64 %lazy_measure_leaked) + tail call void @___dec_future_refcount(i64 %lazy_measure_leaked) + %.not.not376 = icmp eq i64 %read_uint, 2 + %4 = icmp eq i64 %read_uint, 1 + %read_bool117 = tail call i1 @___read_future_bool(i64 %lazy_measure60) + tail call void @___dec_future_refcount(i64 %lazy_measure60) + tail call void @print_bool(ptr nonnull @res_q2.2A5B30FD.0, i64 12, i1 %read_bool117) + %"205_0.0" = zext i1 %4 to i64 + %"210_0.0" = select i1 %.not.not376, i64 2, i64 %"205_0.0" + tail call void @print_int(ptr nonnull @res_q3.D71179D6.0, i64 11, i64 %"210_0.0") br label %5 -5: ; preds = %cond_exit_78, %cond_exit_51 +5: ; preds = %cond_exit_141, %cond_exit_76 ret void } @@ -132,6 +132,10 @@ declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr +declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr + +declare i64 @___read_future_uint(i64) local_unnamed_addr + declare void @print_bool(ptr, i64, i1) local_unnamed_addr ; Function Attrs: noreturn @@ -139,20 +143,16 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_int(ptr, i64, i64) local_unnamed_addr -declare i64 @___read_future_uint(i64) local_unnamed_addr - -declare i64 @___lazy_measure_leaked(i64) local_unnamed_addr - declare i64 @___qalloc() local_unnamed_addr declare void @___reset(i64) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr -declare void @___rpp(i64, i64, double, double) local_unnamed_addr - declare void @___rz(i64, double) local_unnamed_addr +declare void @___rpp(i64, i64, double, double) local_unnamed_addr + define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-apple-darwin.ll index 5f677fc7..df2bb845 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-apple-darwin.ll @@ -5,467 +5,447 @@ target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-unknown-linux-gnu.ll index 96f528b0..bc26a9a7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-aarch64-unknown-linux-gnu.ll @@ -5,467 +5,447 @@ target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-apple-darwin.ll index 78788651..a3bd39e6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-apple-darwin.ll @@ -5,467 +5,447 @@ target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-unknown-linux-gnu.ll index 98d80e82..860f9124 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-unknown-linux-gnu.ll @@ -5,467 +5,447 @@ target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-windows-gnu.ll index a1fa25e9..159548e0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-helios-x86_64-windows-gnu.ll @@ -5,467 +5,447 @@ target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-apple-darwin.ll index e5562d0f..35784a36 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-apple-darwin.ll @@ -5,474 +5,454 @@ target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-unknown-linux-gnu.ll index a1c2c045..6e546134 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-aarch64-unknown-linux-gnu.ll @@ -5,474 +5,454 @@ target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-apple-darwin.ll index 1ebc7316..e135786c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-apple-darwin.ll @@ -5,474 +5,454 @@ target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-unknown-linux-gnu.ll index 97476699..99a310d4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-unknown-linux-gnu.ll @@ -5,474 +5,454 @@ target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-windows-gnu.ll index 858c6716..0da6e542 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics/metrics-sol-x86_64-windows-gnu.ll @@ -5,474 +5,454 @@ target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-apple-darwin.ll index 481d3c58..07c64f33 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-apple-darwin.ll @@ -10,11 +10,11 @@ target triple = "aarch64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_helios_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rxy(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rxy(i64 %2, double 0x400921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rzz(i64 %1, i64 %2, double 0x3FF921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-unknown-linux-gnu.ll index dcba532e..39d99532 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-aarch64-unknown-linux-gnu.ll @@ -10,11 +10,11 @@ target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_helios_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rxy(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rxy(i64 %2, double 0x400921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rzz(i64 %1, i64 %2, double 0x3FF921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-apple-darwin.ll index f2a1b904..489abacd 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-apple-darwin.ll @@ -10,11 +10,11 @@ target triple = "x86_64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_helios_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rxy(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rxy(i64 %2, double 0x400921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rzz(i64 %1, i64 %2, double 0x3FF921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-unknown-linux-gnu.ll index 397c6c1d..fd8b8dc9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-unknown-linux-gnu.ll @@ -10,11 +10,11 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_helios_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rxy(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rxy(i64 %2, double 0x400921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rzz(i64 %1, i64 %2, double 0x3FF921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-windows-gnu.ll index 0937b331..7264ecfc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-helios-x86_64-windows-gnu.ll @@ -10,11 +10,11 @@ target triple = "x86_64-windows-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_helios_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_helios_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_helios_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rxy(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_helios_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_helios_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rxy(i64 %2, double 0x400921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rzz(i64 %1, i64 %2, double 0x3FF921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-apple-darwin.ll index 65ead47b..aab72dc4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-apple-darwin.ll @@ -10,11 +10,11 @@ target triple = "aarch64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_sol_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rp(i64 %2, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %2, double 0xC002D97C7F3321D2) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-unknown-linux-gnu.ll index 87408205..1028b437 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-aarch64-unknown-linux-gnu.ll @@ -10,11 +10,11 @@ target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_sol_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rp(i64 %2, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %2, double 0xC002D97C7F3321D2) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-apple-darwin.ll index e81dccc4..589869a1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-apple-darwin.ll @@ -10,11 +10,11 @@ target triple = "x86_64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_sol_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rp(i64 %2, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %2, double 0xC002D97C7F3321D2) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-unknown-linux-gnu.ll index a54f2386..877ce620 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-unknown-linux-gnu.ll @@ -10,11 +10,11 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_sol_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rp(i64 %2, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %2, double 0xC002D97C7F3321D2) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-windows-gnu.ll index 538ce86a..fa9676df 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_metrics_on_exit/metrics_on_exit-sol-x86_64-windows-gnu.ll @@ -10,11 +10,11 @@ target triple = "x86_64-windows-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.39() - %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.81(i64 %0) - %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.53() - %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.67() - %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %2, i64 %3) + %0 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %1 = tail call fastcc i64 @__hugr__.__tk2_sol_h.40(i64 %0) + %2 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %3 = tail call fastcc i64 @__hugr__.__tk2_sol_qalloc.26() + %4 = tail call fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %2, i64 %3) %lazy_measure = tail call i64 @___lazy_measure(i64 %4) tail call void @___qfree(i64 %4) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) @@ -24,59 +24,29 @@ alloca_block: unreachable } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.39() unnamed_addr { +define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.26() unnamed_addr { alloca_block: %qalloc = tail call i64 @___qalloc() %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_43_case_0, label %reset_bb + br i1 %not_max.not.not, label %cond_30_case_0, label %reset_bb reset_bb: ; preds = %alloca_block tail call void @___reset(i64 %qalloc) ret i64 %qalloc -cond_43_case_0: ; preds = %alloca_block +cond_30_case_0: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable } -define internal fastcc i64 @__hugr__.__tk2_sol_h.81(i64 returned %0) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_h.40(i64 returned %0) unnamed_addr { alloca_block: tail call void @___rp(i64 %0, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %0, double 0x400921FB54442D18) ret i64 %0 } -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.53() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_57_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_57_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc range(i64 0, -1) i64 @__hugr__.__tk2_sol_qalloc.67() unnamed_addr { -alloca_block: - %qalloc = tail call i64 @___qalloc() - %not_max.not.not = icmp eq i64 %qalloc, -1 - br i1 %not_max.not.not, label %cond_71_case_0, label %reset_bb - -reset_bb: ; preds = %alloca_block - tail call void @___reset(i64 %qalloc) - ret i64 %qalloc - -cond_71_case_0: ; preds = %alloca_block - tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") - unreachable -} - -define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.92(i64 %0, i64 %1, i64 %2) unnamed_addr { +define internal fastcc i64 @__hugr__.__tk2_sol_toffoli.52(i64 %0, i64 %1, i64 %2) unnamed_addr { alloca_block: tail call void @___rp(i64 %2, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %2, double 0xC002D97C7F3321D2) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-apple-darwin.ll index a360b30a..bdfb5415 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_helios_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-unknown-linux-gnu.ll index e03a097a..2b45126b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_helios_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-apple-darwin.ll index 289a4fcb..95ac9b61 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_helios_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-unknown-linux-gnu.ll index 3dbfaeac..54556a3e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_helios_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-windows-gnu.ll index 9d1f8f8f..1656f032 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-helios-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_helios_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_helios_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-apple-darwin.ll index b7a219c8..ba58d738 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_sol_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-unknown-linux-gnu.ll index 0783951c..088e6dcd 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-aarch64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_sol_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-apple-darwin.ll index cfb66e82..be411884 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-apple-darwin.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_sol_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-unknown-linux-gnu.ll index cb9a63c7..53406a7e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-unknown-linux-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_sol_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-windows-gnu.ll index 6e311c0e..f04cb2da 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_no_results/no_results-sol-x86_64-windows-gnu.ll @@ -9,13 +9,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_18_case_0.i, label %__hugr__.__tk2_sol_qalloc.14.exit + br i1 %not_max.not.not.i, label %cond_11_case_0.i, label %__hugr__.__tk2_sol_qalloc.7.exit -cond_18_case_0.i: ; preds = %alloca_block +cond_11_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.14.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.7.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-apple-darwin.ll index c88063c9..0c961d3e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-unknown-linux-gnu.ll index 582f6c08..2fefffd7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-apple-darwin.ll index 7c7971ec..f95ebc14 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-unknown-linux-gnu.ll index 4463f3b7..f59902e7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-windows-gnu.ll index 0bc09657..62a09e02 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-helios-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-apple-darwin.ll index 21fd8994..e98c236e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-unknown-linux-gnu.ll index 9ed8c7e8..931e2eb8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-apple-darwin.ll index 2b840add..21fa8787 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-unknown-linux-gnu.ll index e09da1bc..74082299 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-windows-gnu.ll index 8c0333bb..4de6fbba 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_panic/panic-sol-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-apple-darwin.ll index 0e2ffbcd..8f5d2be2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-apple-darwin.ll @@ -3,886 +3,757 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.498.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.498.exit.8, %__hugr__.__tk2_helios_qalloc.498.exit.7, %__hugr__.__tk2_helios_qalloc.498.exit.6, %__hugr__.__tk2_helios_qalloc.498.exit.5, %__hugr__.__tk2_helios_qalloc.498.exit.4, %__hugr__.__tk2_helios_qalloc.498.exit.3, %__hugr__.__tk2_helios_qalloc.498.exit.2, %__hugr__.__tk2_helios_qalloc.498.exit.1, %__hugr__.__tk2_helios_qalloc.498.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.553.exit.8, %__hugr__.__tk2_helios_qalloc.553.exit.7, %__hugr__.__tk2_helios_qalloc.553.exit.6, %__hugr__.__tk2_helios_qalloc.553.exit.5, %__hugr__.__tk2_helios_qalloc.553.exit.4, %__hugr__.__tk2_helios_qalloc.553.exit.3, %__hugr__.__tk2_helios_qalloc.553.exit.2, %__hugr__.__tk2_helios_qalloc.553.exit.1, %__hugr__.__tk2_helios_qalloc.553.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.1 -__hugr__.__tk2_helios_qalloc.498.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.553.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not781 = icmp eq i64 %10, 0 - br i1 %.not781, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1714 = icmp eq i64 %14, 0 + br i1 %.not1714, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.2 -__hugr__.__tk2_helios_qalloc.498.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.553.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not782 = icmp eq i64 %14, 0 - br i1 %.not782, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1715 = icmp eq i64 %18, 0 + br i1 %.not1715, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.3 -__hugr__.__tk2_helios_qalloc.498.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.553.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not783 = icmp eq i64 %18, 0 - br i1 %.not783, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1716 = icmp eq i64 %22, 0 + br i1 %.not1716, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.4 -__hugr__.__tk2_helios_qalloc.498.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.553.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not784 = icmp eq i64 %22, 0 - br i1 %.not784, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1717 = icmp eq i64 %26, 0 + br i1 %.not1717, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.5 -__hugr__.__tk2_helios_qalloc.498.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.553.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not785 = icmp eq i64 %26, 0 - br i1 %.not785, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1718 = icmp eq i64 %30, 0 + br i1 %.not1718, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.6 -__hugr__.__tk2_helios_qalloc.498.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.553.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not786 = icmp eq i64 %30, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1719 = icmp eq i64 %34, 0 + br i1 %.not1719, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.7 -__hugr__.__tk2_helios_qalloc.498.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.553.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not787 = icmp eq i64 %34, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1720 = icmp eq i64 %38, 0 + br i1 %.not1720, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.8 -__hugr__.__tk2_helios_qalloc.498.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.553.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not788 = icmp eq i64 %38, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1721 = icmp eq i64 %42, 0 + br i1 %.not1721, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not789 = icmp eq i64 %42, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1722 = icmp eq i64 %46, 0 + br i1 %.not1722, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %55, double 0x400921FB54442D18, double 0.000000e+00) - %56 = load i64, ptr %5, align 4 - %57 = and i64 %56, 4 - %.not769 = icmp eq i64 %57, 0 - br i1 %.not769, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %59, double 0x400921FB54442D18, double 0.000000e+00) + %60 = load i64, ptr %9, align 4 + %61 = and i64 %60, 4 + %.not1701 = icmp eq i64 %61, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %58 = and i64 %56, -5 - store i64 %58, ptr %5, align 4 - store i64 %55, ptr %16, align 4 - %59 = load i64, ptr %5, align 4 - %60 = and i64 %59, 8 - %.not770 = icmp eq i64 %60, 0 - br i1 %.not770, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %62 = and i64 %60, -5 + store i64 %62, ptr %9, align 4 + store i64 %59, ptr %20, align 4 + %63 = load i64, ptr %9, align 4 + %64 = and i64 %63, 8 + %.not1702 = icmp eq i64 %64, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %61 = or disjoint i64 %59, 8 - store i64 %61, ptr %5, align 4 - %62 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %62, double 0x400921FB54442D18, double 0.000000e+00) - %63 = load i64, ptr %5, align 4 - %64 = and i64 %63, 8 - %.not771 = icmp eq i64 %64, 0 - br i1 %.not771, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %65 = or disjoint i64 %63, 8 + store i64 %65, ptr %9, align 4 + %66 = load i64, ptr %24, align 4 + tail call void @___rxy(i64 %66, double 0x400921FB54442D18, double 0.000000e+00) + %67 = load i64, ptr %9, align 4 + %68 = and i64 %67, 8 + %.not1703 = icmp eq i64 %68, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %65 = and i64 %63, -9 - store i64 %65, ptr %5, align 4 - store i64 %62, ptr %20, align 4 - %66 = load i64, ptr %5, align 4 - %67 = and i64 %66, 512 - %.not772 = icmp eq i64 %67, 0 - br i1 %.not772, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %69 = and i64 %67, -9 + store i64 %69, ptr %9, align 4 + store i64 %66, ptr %24, align 4 + %70 = load i64, ptr %9, align 4 + %71 = and i64 %70, 512 + %.not1704 = icmp eq i64 %71, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %68 = or disjoint i64 %66, 512 - store i64 %68, ptr %5, align 4 - %69 = load i64, ptr %44, align 4 - tail call void @___rxy(i64 %69, double 0x400921FB54442D18, double 0.000000e+00) - %70 = load i64, ptr %5, align 4 - %71 = and i64 %70, 512 - %.not773 = icmp eq i64 %71, 0 - br i1 %.not773, label %panic.i696, label %__barray_mask_return.exit697 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %72 = or disjoint i64 %70, 512 + store i64 %72, ptr %9, align 4 + %73 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %73, double 0x400921FB54442D18, double 0.000000e+00) + %74 = load i64, ptr %9, align 4 + %75 = and i64 %74, 512 + %.not1705 = icmp eq i64 %75, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %76 = and i64 %74, -513 + store i64 %76, ptr %9, align 4 + store i64 %73, ptr %48, align 4 + br label %__barray_check_bounds.exit1620 + +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_check_bounds.exit1616: ; preds = %.thread + %77 = load i64, ptr %3, align 4 + %78 = lshr i64 %77, %"363_2.01729" + %79 = trunc i64 %78 to i1 + br i1 %79, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %72 = and i64 %70, -513 - store i64 %72, ptr %5, align 4 - store i64 %69, ptr %44, align 4 - %73 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %74 = tail call ptr @heap_alloc(i64 80) - %75 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %75, align 1 - br label %__barray_check_bounds.exit.i.i - -76: ; preds = %loop_body.i - %77 = lshr i64 %.fca.2.extract.i.i, 6 - %78 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %77 - %79 = load i64, ptr %78, align 4 - %80 = and i64 %.fca.2.extract.i.i, 63 - %81 = sub nuw nsw i64 64, %80 - %82 = lshr i64 -1, %81 - %83 = icmp eq i64 %80, 0 - %84 = select i1 %83, i64 0, i64 %82 - %85 = or i64 %79, %84 - store i64 %85, ptr %78, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %86 = lshr i64 %last_valid.i.i.i, 6 - %87 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %86 - %88 = load i64, ptr %87, align 4 - %89 = and i64 %last_valid.i.i.i, 63 - %90 = shl nsw i64 -2, %89 - %91 = icmp eq i64 %89, 63 - %92 = select i1 %91, i64 0, i64 %90 - %93 = or i64 %88, %92 - store i64 %93, ptr %87, align 4 - %reass.sub.i.i.i = sub nsw i64 %86, %77 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -94: ; preds = %mask_block_ok.i.i.i - %95 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %76, %94 - %.02.i.i.i = phi i64 [ %95, %94 ], [ 0, %76 ] - %gep.i.i.i = getelementptr i64, ptr %78, i64 %.02.i.i.i - %96 = load i64, ptr %gep.i.i.i, align 4 - %97 = icmp eq i64 %96, -1 - br i1 %97, label %94, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i +mask_block_ok.i: ; preds = %cond_exit_367 + %80 = load i64, ptr %9, align 4 + %81 = or i64 %80, -1024 + store i64 %81, ptr %9, align 4 + %82 = icmp eq i64 %81, -1 + br i1 %82, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %98, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %73, %__barray_mask_return.exit697 ], [ %113, %loop_body.i ] - %98 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %99 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %100 = lshr i64 %99, 6 - %101 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %100 - %102 = load i64, ptr %101, align 4 - %103 = and i64 %99, 63 - %104 = lshr i64 %102, %103 - %105 = trunc i64 %104 to i1 - br i1 %105, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01730" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %83, %cond_exit_367 ] + %"363_2.01729" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %91, %cond_exit_367 ] + %83 = add nuw nsw i64 %"363_0.sroa.15.01730", 1 + %84 = load i64, ptr %9, align 4 + %85 = lshr i64 %84, %"363_0.sroa.15.01730" + %86 = trunc i64 %85 to i1 + br i1 %86, label %panic.i1621, label %.thread -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %106 = shl nuw i64 1, %103 - %107 = xor i64 %106, %102 - store i64 %107, ptr %101, align 4 - %108 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %99 - %109 = load i64, ptr %108, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %109) - tail call void @___qfree(i64 %109) - %110 = load i64, ptr %75, align 4 - %111 = lshr i64 %110, %"239_0.sroa.15.0178.i" - %112 = trunc i64 %111 to i1 - br i1 %112, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %113 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %98, 1 - %114 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %115 = xor i64 %110, %114 - store i64 %115, ptr %75, align 4 - %116 = getelementptr inbounds nuw i64, ptr %74, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %116, align 4 - %117 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %117, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %117, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %117, 2 - %exitcond.not.i = icmp eq i64 %98, 10 - br i1 %exitcond.not.i, label %76, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %94, %76 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %74, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %75, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %118 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %119 = tail call ptr @heap_alloc(i64 10) - %120 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %120, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 0 - %121 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %122 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %"545_1.sroa.10.0.i.i", 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %127 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %269, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %128, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %118, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %265, %loop_body.i701 ] - %128 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %127, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %127, 1 - %129 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %130 = lshr i64 %129, 6 - %131 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %130 - %132 = load i64, ptr %131, align 4 - %133 = and i64 %129, 63 - %134 = lshr i64 %132, %133 - %135 = trunc i64 %134 to i1 - br i1 %135, label %panic.i.i.i713, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i713: ; preds = %__barray_check_bounds.exit.i.i698 +.thread: ; preds = %__barray_check_bounds.exit1620 + %87 = shl nuw nsw i64 1, %"363_0.sroa.15.01730" + %88 = xor i64 %84, %87 + store i64 %88, ptr %9, align 4 + %89 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01730" + %90 = load i64, ptr %89, align 4 + %91 = add i64 %"363_2.01729", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %90) + tail call void @___qfree(i64 %90) + %92 = icmp ult i64 %"363_2.01729", 10 + br i1 %92, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %93 = shl nuw nsw i64 1, %"363_2.01729" + %94 = xor i64 %77, %93 + store i64 %94, ptr %3, align 4 + %95 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01729" + store i64 %lazy_measure, ptr %95, align 4 + %96 = icmp samesign ugt i64 %"363_0.sroa.15.01730", 8 + br i1 %96, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %97, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %97 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %98 = load i64, ptr %3, align 4 + %99 = lshr i64 %98, %"429_0.sroa.15.01708" + %100 = trunc i64 %99 to i1 + br i1 %100, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %127, 0 - %136 = shl nuw i64 1, %133 - %137 = xor i64 %136, %132 - store i64 %137, ptr %131, align 4 - %138 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %129 - %139 = load i64, ptr %138, align 4 - tail call void @___inc_future_refcount(i64 %139) - %140 = load i64, ptr %131, align 4 - %141 = lshr i64 %140, %133 - %142 = trunc i64 %141 to i1 - br i1 %142, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %101 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %102 = xor i64 %98, %101 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %104 = load i64, ptr %103, align 4 + tail call void @___inc_future_refcount(i64 %104) + %105 = load i64, ptr %3, align 4 + %106 = lshr i64 %105, %"429_0.sroa.15.01708" + %107 = trunc i64 %106 to i1 + br i1 %107, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -143: ; preds = %mask_block_ok.i.i.i705 - %144 = add nuw i64 %.02.i.i.i706, 1 - %exitcond.not.i.i.i709 = icmp eq i64 %.02.i.i.i706, %reass.sub.i.i.i703 - br i1 %exitcond.not.i.i.i709, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -mask_block_ok.i.i.i705: ; preds = %cond_exit_548.thread.9.i.i, %143 - %.02.i.i.i706 = phi i64 [ %144, %143 ], [ 0, %cond_exit_548.thread.9.i.i ] - %gep.i.i.i707 = getelementptr i64, ptr %122, i64 %.02.i.i.i706 - %145 = load i64, ptr %gep.i.i.i707, align 4 - %146 = icmp eq i64 %145, -1 - br i1 %146, label %143, label %mask_block_err.i.i.i708 - -mask_block_err.i.i.i708: ; preds = %mask_block_ok.i.i.i705 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %108 = xor i64 %105, %101 + store i64 %108, ptr %3, align 4 + store i64 %104, ptr %103, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %104) + tail call void @___dec_future_refcount(i64 %104) + %109 = load i64, ptr %1, align 4 + %110 = lshr i64 %109, %"429_0.sroa.15.01708" + %111 = trunc i64 %110 to i1 + br i1 %111, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %147 = shl nuw i64 1, %124 - %148 = xor i64 %123, %147 - store i64 %148, ptr %122, align 4 - %149 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %"545_1.sroa.10.0.i.i" - %150 = load i64, ptr %149, align 4 - tail call void @___dec_future_refcount(i64 %150) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %151 = add i64 %"545_1.sroa.10.0.i.i", 1 - %152 = lshr i64 %151, 6 - %153 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %152 - %154 = load i64, ptr %153, align 4 - %155 = and i64 %151, 63 - %156 = lshr i64 %154, %155 - %157 = trunc i64 %156 to i1 - br i1 %157, label %cond_exit_548.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_548.thread.i.i - %158 = shl nuw i64 1, %155 - %159 = xor i64 %154, %158 - store i64 %159, ptr %153, align 4 - %160 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %151 - %161 = load i64, ptr %160, align 4 - tail call void @___dec_future_refcount(i64 %161) - br label %cond_exit_548.thread.1.i.i - -cond_exit_548.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_548.thread.i.i - %162 = add i64 %"545_1.sroa.10.0.i.i", 2 - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_548.thread.1.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %165, %169 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.2.i.i - -cond_exit_548.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_548.thread.1.i.i - %173 = add i64 %"545_1.sroa.10.0.i.i", 3 - %174 = lshr i64 %173, 6 - %175 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %174 - %176 = load i64, ptr %175, align 4 - %177 = and i64 %173, 63 - %178 = lshr i64 %176, %177 - %179 = trunc i64 %178 to i1 - br i1 %179, label %cond_exit_548.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_548.thread.2.i.i - %180 = shl nuw i64 1, %177 - %181 = xor i64 %176, %180 - store i64 %181, ptr %175, align 4 - %182 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %173 - %183 = load i64, ptr %182, align 4 - tail call void @___dec_future_refcount(i64 %183) - br label %cond_exit_548.thread.3.i.i - -cond_exit_548.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_548.thread.2.i.i - %184 = add i64 %"545_1.sroa.10.0.i.i", 4 - %185 = lshr i64 %184, 6 - %186 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %185 - %187 = load i64, ptr %186, align 4 - %188 = and i64 %184, 63 - %189 = lshr i64 %187, %188 - %190 = trunc i64 %189 to i1 - br i1 %190, label %cond_exit_548.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_548.thread.3.i.i - %191 = shl nuw i64 1, %188 - %192 = xor i64 %187, %191 - store i64 %192, ptr %186, align 4 - %193 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %184 - %194 = load i64, ptr %193, align 4 - tail call void @___dec_future_refcount(i64 %194) - br label %cond_exit_548.thread.4.i.i - -cond_exit_548.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_548.thread.3.i.i - %195 = add i64 %"545_1.sroa.10.0.i.i", 5 - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_548.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_548.thread.4.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %198, %202 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_548.thread.5.i.i - -cond_exit_548.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_548.thread.4.i.i - %206 = add i64 %"545_1.sroa.10.0.i.i", 6 - %207 = lshr i64 %206, 6 - %208 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %207 - %209 = load i64, ptr %208, align 4 - %210 = and i64 %206, 63 - %211 = lshr i64 %209, %210 - %212 = trunc i64 %211 to i1 - br i1 %212, label %cond_exit_548.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_548.thread.5.i.i - %213 = shl nuw i64 1, %210 - %214 = xor i64 %209, %213 - store i64 %214, ptr %208, align 4 - %215 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %206 - %216 = load i64, ptr %215, align 4 - tail call void @___dec_future_refcount(i64 %216) - br label %cond_exit_548.thread.6.i.i - -cond_exit_548.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_548.thread.5.i.i - %217 = add i64 %"545_1.sroa.10.0.i.i", 7 - %218 = lshr i64 %217, 6 - %219 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %218 - %220 = load i64, ptr %219, align 4 - %221 = and i64 %217, 63 - %222 = lshr i64 %220, %221 - %223 = trunc i64 %222 to i1 - br i1 %223, label %cond_exit_548.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_548.thread.6.i.i - %224 = shl nuw i64 1, %221 - %225 = xor i64 %220, %224 - store i64 %225, ptr %219, align 4 - %226 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %217 - %227 = load i64, ptr %226, align 4 - tail call void @___dec_future_refcount(i64 %227) - br label %cond_exit_548.thread.7.i.i - -cond_exit_548.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_548.thread.6.i.i - %228 = add i64 %"545_1.sroa.10.0.i.i", 8 - %229 = lshr i64 %228, 6 - %230 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %229 - %231 = load i64, ptr %230, align 4 - %232 = and i64 %228, 63 - %233 = lshr i64 %231, %232 - %234 = trunc i64 %233 to i1 - br i1 %234, label %cond_exit_548.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_548.thread.7.i.i - %235 = shl nuw i64 1, %232 - %236 = xor i64 %231, %235 - store i64 %236, ptr %230, align 4 - %237 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %228 - %238 = load i64, ptr %237, align 4 - tail call void @___dec_future_refcount(i64 %238) - br label %cond_exit_548.thread.8.i.i - -cond_exit_548.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_548.thread.7.i.i - %239 = add i64 %"545_1.sroa.10.0.i.i", 9 - %240 = lshr i64 %239, 6 - %241 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %240 - %242 = load i64, ptr %241, align 4 - %243 = and i64 %239, 63 - %244 = lshr i64 %242, %243 - %245 = trunc i64 %244 to i1 - br i1 %245, label %cond_exit_548.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_548.thread.8.i.i - %246 = shl nuw i64 1, %243 - %247 = xor i64 %242, %246 - store i64 %247, ptr %241, align 4 - %248 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %239 - %249 = load i64, ptr %248, align 4 - tail call void @___dec_future_refcount(i64 %249) - br label %cond_exit_548.thread.9.i.i - -cond_exit_548.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_548.thread.8.i.i - %250 = load i64, ptr %122, align 4 - %251 = sub nuw nsw i64 64, %124 - %252 = lshr i64 -1, %251 - %253 = icmp eq i64 %124, 0 - %254 = select i1 %253, i64 0, i64 %252 - %255 = or i64 %250, %254 - store i64 %255, ptr %122, align 4 - %256 = load i64, ptr %241, align 4 - %257 = shl nsw i64 -2, %243 - %258 = icmp eq i64 %243, 63 - %259 = select i1 %258, i64 0, i64 %257 - %260 = or i64 %256, %259 - store i64 %260, ptr %241, align 4 - %reass.sub.i.i.i703 = sub nsw i64 %240, %121 - %.not.i.i.i704 = icmp eq i64 %reass.sub.i.i.i703, -1 - br i1 %.not.i.i.i704, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %261 = xor i64 %140, %136 - store i64 %261, ptr %131, align 4 - store i64 %139, ptr %138, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %139) - tail call void @___dec_future_refcount(i64 %139) - %262 = load i64, ptr %120, align 4 - %263 = lshr i64 %262, %"280_0.sroa.15.0168.i" - %264 = trunc i64 %263 to i1 - br i1 %264, label %loop_body.i701, label %panic.i.i700 - -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %265 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %128, 1 - %266 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %267 = xor i64 %262, %266 - store i64 %267, ptr %120, align 4 - %268 = getelementptr inbounds nuw i1, ptr %119, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %268, align 1 - %269 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %128, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %143, %cond_exit_548.thread.9.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %270 = load i64, ptr %120, align 4 - %271 = and i64 %270, 1023 - store i64 %271, ptr %120, align 4 - %272 = icmp eq i64 %271, 0 - br i1 %272, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %273 = tail call ptr @heap_alloc(i64 10) - %274 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %274, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %273, ptr noundef nonnull align 1 dereferenceable(10) %119, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %273) - %275 = load i64, ptr %120, align 4 - %276 = and i64 %275, 1023 - store i64 %276, ptr %120, align 4 - %277 = icmp eq i64 %276, 0 - br i1 %277, label %__barray_check_none_borrowed.exit719, label %mask_block_err.i717 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %112 = or disjoint i64 %165, 1 + store i64 %112, ptr %3, align 4 + %113 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %113) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not1732 = icmp eq i64 %115, 0 + br i1 %.not1732, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %116 = or disjoint i64 %114, 2 + store i64 %116, ptr %3, align 4 + %117 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %118 = load i64, ptr %117, align 4 + tail call void @___dec_future_refcount(i64 %118) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %119 = load i64, ptr %3, align 4 + %120 = and i64 %119, 4 + %.not1733 = icmp eq i64 %120, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %121 = or disjoint i64 %119, 4 + store i64 %121, ptr %3, align 4 + %122 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %123 = load i64, ptr %122, align 4 + tail call void @___dec_future_refcount(i64 %123) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %124 = load i64, ptr %3, align 4 + %125 = and i64 %124, 8 + %.not1734 = icmp eq i64 %125, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %3, align 4 + %127 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %128 = load i64, ptr %127, align 4 + tail call void @___dec_future_refcount(i64 %128) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %129 = load i64, ptr %3, align 4 + %130 = and i64 %129, 16 + %.not1735 = icmp eq i64 %130, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %131 = or disjoint i64 %129, 16 + store i64 %131, ptr %3, align 4 + %132 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %133 = load i64, ptr %132, align 4 + tail call void @___dec_future_refcount(i64 %133) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %134 = load i64, ptr %3, align 4 + %135 = and i64 %134, 32 + %.not1736 = icmp eq i64 %135, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %136 = or disjoint i64 %134, 32 + store i64 %136, ptr %3, align 4 + %137 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %138 = load i64, ptr %137, align 4 + tail call void @___dec_future_refcount(i64 %138) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %139 = load i64, ptr %3, align 4 + %140 = and i64 %139, 64 + %.not1737 = icmp eq i64 %140, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %141 = or disjoint i64 %139, 64 + store i64 %141, ptr %3, align 4 + %142 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %143 = load i64, ptr %142, align 4 + tail call void @___dec_future_refcount(i64 %143) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %144 = load i64, ptr %3, align 4 + %145 = and i64 %144, 128 + %.not1738 = icmp eq i64 %145, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %146 = or disjoint i64 %144, 128 + store i64 %146, ptr %3, align 4 + %147 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %148 = load i64, ptr %147, align 4 + tail call void @___dec_future_refcount(i64 %148) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %149 = load i64, ptr %3, align 4 + %150 = and i64 %149, 256 + %.not1739 = icmp eq i64 %150, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %151 = or disjoint i64 %149, 256 + store i64 %151, ptr %3, align 4 + %152 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %153 = load i64, ptr %152, align 4 + tail call void @___dec_future_refcount(i64 %153) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %154 = load i64, ptr %3, align 4 + %155 = and i64 %154, 512 + %.not1740 = icmp eq i64 %155, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %156 = or disjoint i64 %154, 512 + store i64 %156, ptr %3, align 4 + %157 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %158 = load i64, ptr %157, align 4 + tail call void @___dec_future_refcount(i64 %158) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %159 = load i64, ptr %3, align 4 + %160 = or i64 %159, -1024 + store i64 %160, ptr %3, align 4 + %161 = icmp eq i64 %160, -1 + br i1 %161, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %162 = xor i64 %109, %101 + store i64 %162, ptr %1, align 4 + %163 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %163, align 1 + %164 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %164, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %165 = load i64, ptr %3, align 4 + %166 = trunc i64 %165 to i1 + br i1 %166, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %167 = load i64, ptr %1, align 4 + %168 = and i64 %167, 1023 + store i64 %168, ptr %1, align 4 + %169 = icmp eq i64 %168, 0 + br i1 %169, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %170 = tail call ptr @heap_alloc(i64 10) + %171 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %171, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %170, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %170) + %172 = load i64, ptr %1, align 4 + %173 = and i64 %172, 1023 + store i64 %173, ptr %1, align 4 + %174 = icmp eq i64 %173, 0 + br i1 %174, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit719: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %278 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %278, i8 0, i64 10, i1 false) + %175 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %175, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %119, ptr %arr_ptr, align 8 - store ptr %278, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %175, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit727 + br label %__barray_check_bounds.exit1657 -mask_block_err.i717: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit727: ; preds = %cond_exit_94, %__barray_check_none_borrowed.exit719 - %"89_0.sroa.0.0777" = phi i64 [ 0, %__barray_check_none_borrowed.exit719 ], [ %285, %cond_exit_94 ] - %279 = lshr i64 %"89_0.sroa.0.0777", 6 - %280 = getelementptr inbounds nuw i64, ptr %3, i64 %279 - %281 = load i64, ptr %280, align 4 - %282 = and i64 %"89_0.sroa.0.0777", 63 - %283 = lshr i64 %281, %282 - %284 = trunc i64 %283 to i1 - br i1 %284, label %cond_exit_94, label %panic.i728 - -panic.i728: ; preds = %__barray_check_bounds.exit727 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %182, %cond_exit_147 ] + %176 = lshr i64 %"143_2.01709", 6 + %177 = getelementptr inbounds nuw i64, ptr %7, i64 %176 + %178 = load i64, ptr %177, align 4 + %179 = and i64 %"143_2.01709", 63 + %180 = lshr i64 %178, %179 + %181 = trunc i64 %180 to i1 + br i1 %181, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit727 - %285 = add nuw nsw i64 %"89_0.sroa.0.0777", 1 - %286 = shl nuw i64 1, %282 - %287 = xor i64 %281, %286 - store i64 %287, ptr %280, align 4 - %288 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0777" - store i64 %"89_0.sroa.0.0777", ptr %288, align 4 - %exitcond.not = icmp eq i64 %285, 100 - br i1 %exitcond.not, label %loop_out127, label %__barray_check_bounds.exit727 - -loop_out127: ; preds = %cond_exit_94 - %289 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %290 = load i64, ptr %289, align 4 - %291 = and i64 %290, 68719476735 - store i64 %291, ptr %289, align 4 - %292 = load i64, ptr %3, align 4 - %293 = icmp eq i64 %292, 0 - %294 = icmp eq i64 %291, 0 - %or.cond = select i1 %293, i1 %294, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit734, label %mask_block_err.i732 - -__barray_check_none_borrowed.exit734: ; preds = %loop_out127 - %295 = call ptr @heap_alloc(i64 800) - %296 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %296, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %295, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %295) - %297 = load i64, ptr %289, align 4 - %298 = and i64 %297, 68719476735 - store i64 %298, ptr %289, align 4 - %299 = load i64, ptr %3, align 4 - %300 = icmp eq i64 %299, 0 - %301 = icmp eq i64 %298, 0 - %or.cond790 = select i1 %300, i1 %301, i1 false - br i1 %or.cond790, label %__barray_check_none_borrowed.exit739, label %mask_block_err.i737 - -mask_block_err.i732: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %182 = add nuw nsw i64 %"143_2.01709", 1 + %183 = shl nuw i64 1, %179 + %184 = xor i64 %178, %183 + store i64 %184, ptr %177, align 4 + %185 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %185, align 4 + %exitcond = icmp eq i64 %182, 100 + br i1 %exitcond, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147 + %186 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %187 = load i64, ptr %186, align 4 + %188 = and i64 %187, 68719476735 + store i64 %188, ptr %186, align 4 + %189 = load i64, ptr %7, align 4 + %190 = icmp eq i64 %189, 0 + %191 = icmp eq i64 %188, 0 + %or.cond = select i1 %190, i1 %191, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %192 = call ptr @heap_alloc(i64 800) + %193 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %193, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %192, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %192) + %194 = load i64, ptr %186, align 4 + %195 = and i64 %194, 68719476735 + store i64 %195, ptr %186, align 4 + %196 = load i64, ptr %7, align 4 + %197 = icmp eq i64 %196, 0 + %198 = icmp eq i64 %195, 0 + %or.cond1726 = select i1 %197, i1 %198, i1 false + br i1 %or.cond1726, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit739: ; preds = %__barray_check_none_borrowed.exit734 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %302 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %302, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %302, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit747 - -mask_block_err.i737: ; preds = %__barray_check_none_borrowed.exit734 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %199 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %199, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %199, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit747: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit739 - %"124_0.sroa.0.0779" = phi i64 [ 0, %__barray_check_none_borrowed.exit739 ], [ %311, %cond_exit_129 ] - %303 = lshr i64 %"124_0.sroa.0.0779", 6 - %304 = getelementptr inbounds nuw i64, ptr %1, i64 %303 - %305 = load i64, ptr %304, align 4 - %306 = and i64 %"124_0.sroa.0.0779", 63 - %307 = lshr i64 %305, %306 - %308 = trunc i64 %307 to i1 - br i1 %308, label %cond_exit_129, label %panic.i748 - -panic.i748: ; preds = %__barray_check_bounds.exit747 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %208, %cond_exit_253 ] + %200 = lshr i64 %"249_2.01711", 6 + %201 = getelementptr inbounds nuw i64, ptr %5, i64 %200 + %202 = load i64, ptr %201, align 4 + %203 = and i64 %"249_2.01711", 63 + %204 = lshr i64 %202, %203 + %205 = trunc i64 %204 to i1 + br i1 %205, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit747 - %309 = uitofp nneg i64 %"124_0.sroa.0.0779" to double - %310 = fmul double %309, 6.250000e-02 - %311 = add nuw nsw i64 %"124_0.sroa.0.0779", 1 - %312 = shl nuw i64 1, %306 - %313 = xor i64 %305, %312 - store i64 %313, ptr %304, align 4 - %314 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0779" - store double %310, ptr %314, align 8 - %exitcond780.not = icmp eq i64 %311, 100 - br i1 %exitcond780.not, label %loop_out211, label %__barray_check_bounds.exit747 - -loop_out211: ; preds = %cond_exit_129 - %315 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %316 = load i64, ptr %315, align 4 - %317 = and i64 %316, 68719476735 - store i64 %317, ptr %315, align 4 - %318 = load i64, ptr %1, align 4 - %319 = icmp eq i64 %318, 0 - %320 = icmp eq i64 %317, 0 - %or.cond791 = select i1 %319, i1 %320, i1 false - br i1 %or.cond791, label %__barray_check_none_borrowed.exit754, label %mask_block_err.i752 - -__barray_check_none_borrowed.exit754: ; preds = %loop_out211 - %321 = call ptr @heap_alloc(i64 800) - %322 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %322, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %321, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %321) - %323 = load i64, ptr %315, align 4 - %324 = and i64 %323, 68719476735 - store i64 %324, ptr %315, align 4 - %325 = load i64, ptr %1, align 4 - %326 = icmp eq i64 %325, 0 - %327 = icmp eq i64 %324, 0 - %or.cond792 = select i1 %326, i1 %327, i1 false - br i1 %or.cond792, label %__barray_check_none_borrowed.exit759, label %mask_block_err.i757 - -mask_block_err.i752: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %206 = uitofp nneg i64 %"249_2.01711" to double + %207 = fmul double %206, 6.250000e-02 + %208 = add nuw nsw i64 %"249_2.01711", 1 + %209 = shl nuw i64 1, %203 + %210 = xor i64 %202, %209 + store i64 %210, ptr %201, align 4 + %211 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %207, ptr %211, align 8 + %exitcond1713 = icmp eq i64 %208, 100 + br i1 %exitcond1713, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %212 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %213 = load i64, ptr %212, align 4 + %214 = and i64 %213, 68719476735 + store i64 %214, ptr %212, align 4 + %215 = load i64, ptr %5, align 4 + %216 = icmp eq i64 %215, 0 + %217 = icmp eq i64 %214, 0 + %or.cond1727 = select i1 %216, i1 %217, i1 false + br i1 %or.cond1727, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %218 = call ptr @heap_alloc(i64 800) + %219 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %219, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %218, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %218) + %220 = load i64, ptr %212, align 4 + %221 = and i64 %220, 68719476735 + store i64 %221, ptr %212, align 4 + %222 = load i64, ptr %5, align 4 + %223 = icmp eq i64 %222, 0 + %224 = icmp eq i64 %221, 0 + %or.cond1728 = select i1 %223, i1 %224, i1 false + br i1 %or.cond1728, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit759: ; preds = %__barray_check_none_borrowed.exit754 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %328 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %328, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %328, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %225 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %225, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %225, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i757: ; preds = %__barray_check_none_borrowed.exit754 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -895,26 +766,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-unknown-linux-gnu.ll index 60f6daec..50d784ee 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-aarch64-unknown-linux-gnu.ll @@ -3,886 +3,757 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.498.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.553.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.498.exit.8, %__hugr__.__tk2_helios_qalloc.498.exit.7, %__hugr__.__tk2_helios_qalloc.498.exit.6, %__hugr__.__tk2_helios_qalloc.498.exit.5, %__hugr__.__tk2_helios_qalloc.498.exit.4, %__hugr__.__tk2_helios_qalloc.498.exit.3, %__hugr__.__tk2_helios_qalloc.498.exit.2, %__hugr__.__tk2_helios_qalloc.498.exit.1, %__hugr__.__tk2_helios_qalloc.498.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.553.exit.8, %__hugr__.__tk2_helios_qalloc.553.exit.7, %__hugr__.__tk2_helios_qalloc.553.exit.6, %__hugr__.__tk2_helios_qalloc.553.exit.5, %__hugr__.__tk2_helios_qalloc.553.exit.4, %__hugr__.__tk2_helios_qalloc.553.exit.3, %__hugr__.__tk2_helios_qalloc.553.exit.2, %__hugr__.__tk2_helios_qalloc.553.exit.1, %__hugr__.__tk2_helios_qalloc.553.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.1 -__hugr__.__tk2_helios_qalloc.498.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.553.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not781 = icmp eq i64 %10, 0 - br i1 %.not781, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1714 = icmp eq i64 %14, 0 + br i1 %.not1714, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.2 -__hugr__.__tk2_helios_qalloc.498.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.553.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not782 = icmp eq i64 %14, 0 - br i1 %.not782, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1715 = icmp eq i64 %18, 0 + br i1 %.not1715, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.3 -__hugr__.__tk2_helios_qalloc.498.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.553.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not783 = icmp eq i64 %18, 0 - br i1 %.not783, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1716 = icmp eq i64 %22, 0 + br i1 %.not1716, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.4 -__hugr__.__tk2_helios_qalloc.498.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.553.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not784 = icmp eq i64 %22, 0 - br i1 %.not784, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1717 = icmp eq i64 %26, 0 + br i1 %.not1717, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.5 -__hugr__.__tk2_helios_qalloc.498.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.553.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not785 = icmp eq i64 %26, 0 - br i1 %.not785, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1718 = icmp eq i64 %30, 0 + br i1 %.not1718, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.6 -__hugr__.__tk2_helios_qalloc.498.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.553.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not786 = icmp eq i64 %30, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1719 = icmp eq i64 %34, 0 + br i1 %.not1719, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.7 -__hugr__.__tk2_helios_qalloc.498.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.553.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not787 = icmp eq i64 %34, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1720 = icmp eq i64 %38, 0 + br i1 %.not1720, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__hugr__.__tk2_helios_qalloc.498.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__hugr__.__tk2_helios_qalloc.553.exit.8 -__hugr__.__tk2_helios_qalloc.498.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.553.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not788 = icmp eq i64 %38, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.498.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1721 = icmp eq i64 %42, 0 + br i1 %.not1721, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_helios_qalloc.553.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not789 = icmp eq i64 %42, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1722 = icmp eq i64 %46, 0 + br i1 %.not1722, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = load i64, ptr %16, align 4 - tail call void @___rxy(i64 %55, double 0x400921FB54442D18, double 0.000000e+00) - %56 = load i64, ptr %5, align 4 - %57 = and i64 %56, 4 - %.not769 = icmp eq i64 %57, 0 - br i1 %.not769, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = load i64, ptr %20, align 4 + tail call void @___rxy(i64 %59, double 0x400921FB54442D18, double 0.000000e+00) + %60 = load i64, ptr %9, align 4 + %61 = and i64 %60, 4 + %.not1701 = icmp eq i64 %61, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %58 = and i64 %56, -5 - store i64 %58, ptr %5, align 4 - store i64 %55, ptr %16, align 4 - %59 = load i64, ptr %5, align 4 - %60 = and i64 %59, 8 - %.not770 = icmp eq i64 %60, 0 - br i1 %.not770, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %62 = and i64 %60, -5 + store i64 %62, ptr %9, align 4 + store i64 %59, ptr %20, align 4 + %63 = load i64, ptr %9, align 4 + %64 = and i64 %63, 8 + %.not1702 = icmp eq i64 %64, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %61 = or disjoint i64 %59, 8 - store i64 %61, ptr %5, align 4 - %62 = load i64, ptr %20, align 4 - tail call void @___rxy(i64 %62, double 0x400921FB54442D18, double 0.000000e+00) - %63 = load i64, ptr %5, align 4 - %64 = and i64 %63, 8 - %.not771 = icmp eq i64 %64, 0 - br i1 %.not771, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %65 = or disjoint i64 %63, 8 + store i64 %65, ptr %9, align 4 + %66 = load i64, ptr %24, align 4 + tail call void @___rxy(i64 %66, double 0x400921FB54442D18, double 0.000000e+00) + %67 = load i64, ptr %9, align 4 + %68 = and i64 %67, 8 + %.not1703 = icmp eq i64 %68, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %65 = and i64 %63, -9 - store i64 %65, ptr %5, align 4 - store i64 %62, ptr %20, align 4 - %66 = load i64, ptr %5, align 4 - %67 = and i64 %66, 512 - %.not772 = icmp eq i64 %67, 0 - br i1 %.not772, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %69 = and i64 %67, -9 + store i64 %69, ptr %9, align 4 + store i64 %66, ptr %24, align 4 + %70 = load i64, ptr %9, align 4 + %71 = and i64 %70, 512 + %.not1704 = icmp eq i64 %71, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %68 = or disjoint i64 %66, 512 - store i64 %68, ptr %5, align 4 - %69 = load i64, ptr %44, align 4 - tail call void @___rxy(i64 %69, double 0x400921FB54442D18, double 0.000000e+00) - %70 = load i64, ptr %5, align 4 - %71 = and i64 %70, 512 - %.not773 = icmp eq i64 %71, 0 - br i1 %.not773, label %panic.i696, label %__barray_mask_return.exit697 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %72 = or disjoint i64 %70, 512 + store i64 %72, ptr %9, align 4 + %73 = load i64, ptr %48, align 4 + tail call void @___rxy(i64 %73, double 0x400921FB54442D18, double 0.000000e+00) + %74 = load i64, ptr %9, align 4 + %75 = and i64 %74, 512 + %.not1705 = icmp eq i64 %75, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %76 = and i64 %74, -513 + store i64 %76, ptr %9, align 4 + store i64 %73, ptr %48, align 4 + br label %__barray_check_bounds.exit1620 + +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_check_bounds.exit1616: ; preds = %.thread + %77 = load i64, ptr %3, align 4 + %78 = lshr i64 %77, %"363_2.01729" + %79 = trunc i64 %78 to i1 + br i1 %79, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %72 = and i64 %70, -513 - store i64 %72, ptr %5, align 4 - store i64 %69, ptr %44, align 4 - %73 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %74 = tail call ptr @heap_alloc(i64 80) - %75 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %75, align 1 - br label %__barray_check_bounds.exit.i.i - -76: ; preds = %loop_body.i - %77 = lshr i64 %.fca.2.extract.i.i, 6 - %78 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %77 - %79 = load i64, ptr %78, align 4 - %80 = and i64 %.fca.2.extract.i.i, 63 - %81 = sub nuw nsw i64 64, %80 - %82 = lshr i64 -1, %81 - %83 = icmp eq i64 %80, 0 - %84 = select i1 %83, i64 0, i64 %82 - %85 = or i64 %79, %84 - store i64 %85, ptr %78, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %86 = lshr i64 %last_valid.i.i.i, 6 - %87 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %86 - %88 = load i64, ptr %87, align 4 - %89 = and i64 %last_valid.i.i.i, 63 - %90 = shl nsw i64 -2, %89 - %91 = icmp eq i64 %89, 63 - %92 = select i1 %91, i64 0, i64 %90 - %93 = or i64 %88, %92 - store i64 %93, ptr %87, align 4 - %reass.sub.i.i.i = sub nsw i64 %86, %77 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -94: ; preds = %mask_block_ok.i.i.i - %95 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %76, %94 - %.02.i.i.i = phi i64 [ %95, %94 ], [ 0, %76 ] - %gep.i.i.i = getelementptr i64, ptr %78, i64 %.02.i.i.i - %96 = load i64, ptr %gep.i.i.i, align 4 - %97 = icmp eq i64 %96, -1 - br i1 %97, label %94, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i +mask_block_ok.i: ; preds = %cond_exit_367 + %80 = load i64, ptr %9, align 4 + %81 = or i64 %80, -1024 + store i64 %81, ptr %9, align 4 + %82 = icmp eq i64 %81, -1 + br i1 %82, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %98, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %73, %__barray_mask_return.exit697 ], [ %113, %loop_body.i ] - %98 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %99 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %100 = lshr i64 %99, 6 - %101 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %100 - %102 = load i64, ptr %101, align 4 - %103 = and i64 %99, 63 - %104 = lshr i64 %102, %103 - %105 = trunc i64 %104 to i1 - br i1 %105, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01730" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %83, %cond_exit_367 ] + %"363_2.01729" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %91, %cond_exit_367 ] + %83 = add nuw nsw i64 %"363_0.sroa.15.01730", 1 + %84 = load i64, ptr %9, align 4 + %85 = lshr i64 %84, %"363_0.sroa.15.01730" + %86 = trunc i64 %85 to i1 + br i1 %86, label %panic.i1621, label %.thread -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %106 = shl nuw i64 1, %103 - %107 = xor i64 %106, %102 - store i64 %107, ptr %101, align 4 - %108 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %99 - %109 = load i64, ptr %108, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %109) - tail call void @___qfree(i64 %109) - %110 = load i64, ptr %75, align 4 - %111 = lshr i64 %110, %"239_0.sroa.15.0178.i" - %112 = trunc i64 %111 to i1 - br i1 %112, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %113 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %98, 1 - %114 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %115 = xor i64 %110, %114 - store i64 %115, ptr %75, align 4 - %116 = getelementptr inbounds nuw i64, ptr %74, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %116, align 4 - %117 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %117, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %117, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %117, 2 - %exitcond.not.i = icmp eq i64 %98, 10 - br i1 %exitcond.not.i, label %76, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %94, %76 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %74, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %75, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %118 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %119 = tail call ptr @heap_alloc(i64 10) - %120 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %120, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 0 - %121 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %122 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %"545_1.sroa.10.0.i.i", 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %127 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %269, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %128, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %118, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %265, %loop_body.i701 ] - %128 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %127, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %127, 1 - %129 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %130 = lshr i64 %129, 6 - %131 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %130 - %132 = load i64, ptr %131, align 4 - %133 = and i64 %129, 63 - %134 = lshr i64 %132, %133 - %135 = trunc i64 %134 to i1 - br i1 %135, label %panic.i.i.i713, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i713: ; preds = %__barray_check_bounds.exit.i.i698 +.thread: ; preds = %__barray_check_bounds.exit1620 + %87 = shl nuw nsw i64 1, %"363_0.sroa.15.01730" + %88 = xor i64 %84, %87 + store i64 %88, ptr %9, align 4 + %89 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01730" + %90 = load i64, ptr %89, align 4 + %91 = add i64 %"363_2.01729", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %90) + tail call void @___qfree(i64 %90) + %92 = icmp ult i64 %"363_2.01729", 10 + br i1 %92, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %93 = shl nuw nsw i64 1, %"363_2.01729" + %94 = xor i64 %77, %93 + store i64 %94, ptr %3, align 4 + %95 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01729" + store i64 %lazy_measure, ptr %95, align 4 + %96 = icmp samesign ugt i64 %"363_0.sroa.15.01730", 8 + br i1 %96, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %97, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %97 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %98 = load i64, ptr %3, align 4 + %99 = lshr i64 %98, %"429_0.sroa.15.01708" + %100 = trunc i64 %99 to i1 + br i1 %100, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %127, 0 - %136 = shl nuw i64 1, %133 - %137 = xor i64 %136, %132 - store i64 %137, ptr %131, align 4 - %138 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %129 - %139 = load i64, ptr %138, align 4 - tail call void @___inc_future_refcount(i64 %139) - %140 = load i64, ptr %131, align 4 - %141 = lshr i64 %140, %133 - %142 = trunc i64 %141 to i1 - br i1 %142, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %101 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %102 = xor i64 %98, %101 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %104 = load i64, ptr %103, align 4 + tail call void @___inc_future_refcount(i64 %104) + %105 = load i64, ptr %3, align 4 + %106 = lshr i64 %105, %"429_0.sroa.15.01708" + %107 = trunc i64 %106 to i1 + br i1 %107, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -143: ; preds = %mask_block_ok.i.i.i705 - %144 = add nuw i64 %.02.i.i.i706, 1 - %exitcond.not.i.i.i709 = icmp eq i64 %.02.i.i.i706, %reass.sub.i.i.i703 - br i1 %exitcond.not.i.i.i709, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -mask_block_ok.i.i.i705: ; preds = %cond_exit_548.thread.9.i.i, %143 - %.02.i.i.i706 = phi i64 [ %144, %143 ], [ 0, %cond_exit_548.thread.9.i.i ] - %gep.i.i.i707 = getelementptr i64, ptr %122, i64 %.02.i.i.i706 - %145 = load i64, ptr %gep.i.i.i707, align 4 - %146 = icmp eq i64 %145, -1 - br i1 %146, label %143, label %mask_block_err.i.i.i708 - -mask_block_err.i.i.i708: ; preds = %mask_block_ok.i.i.i705 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %108 = xor i64 %105, %101 + store i64 %108, ptr %3, align 4 + store i64 %104, ptr %103, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %104) + tail call void @___dec_future_refcount(i64 %104) + %109 = load i64, ptr %1, align 4 + %110 = lshr i64 %109, %"429_0.sroa.15.01708" + %111 = trunc i64 %110 to i1 + br i1 %111, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %147 = shl nuw i64 1, %124 - %148 = xor i64 %123, %147 - store i64 %148, ptr %122, align 4 - %149 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %"545_1.sroa.10.0.i.i" - %150 = load i64, ptr %149, align 4 - tail call void @___dec_future_refcount(i64 %150) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %151 = add i64 %"545_1.sroa.10.0.i.i", 1 - %152 = lshr i64 %151, 6 - %153 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %152 - %154 = load i64, ptr %153, align 4 - %155 = and i64 %151, 63 - %156 = lshr i64 %154, %155 - %157 = trunc i64 %156 to i1 - br i1 %157, label %cond_exit_548.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_548.thread.i.i - %158 = shl nuw i64 1, %155 - %159 = xor i64 %154, %158 - store i64 %159, ptr %153, align 4 - %160 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %151 - %161 = load i64, ptr %160, align 4 - tail call void @___dec_future_refcount(i64 %161) - br label %cond_exit_548.thread.1.i.i - -cond_exit_548.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_548.thread.i.i - %162 = add i64 %"545_1.sroa.10.0.i.i", 2 - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_548.thread.1.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %165, %169 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.2.i.i - -cond_exit_548.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_548.thread.1.i.i - %173 = add i64 %"545_1.sroa.10.0.i.i", 3 - %174 = lshr i64 %173, 6 - %175 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %174 - %176 = load i64, ptr %175, align 4 - %177 = and i64 %173, 63 - %178 = lshr i64 %176, %177 - %179 = trunc i64 %178 to i1 - br i1 %179, label %cond_exit_548.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_548.thread.2.i.i - %180 = shl nuw i64 1, %177 - %181 = xor i64 %176, %180 - store i64 %181, ptr %175, align 4 - %182 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %173 - %183 = load i64, ptr %182, align 4 - tail call void @___dec_future_refcount(i64 %183) - br label %cond_exit_548.thread.3.i.i - -cond_exit_548.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_548.thread.2.i.i - %184 = add i64 %"545_1.sroa.10.0.i.i", 4 - %185 = lshr i64 %184, 6 - %186 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %185 - %187 = load i64, ptr %186, align 4 - %188 = and i64 %184, 63 - %189 = lshr i64 %187, %188 - %190 = trunc i64 %189 to i1 - br i1 %190, label %cond_exit_548.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_548.thread.3.i.i - %191 = shl nuw i64 1, %188 - %192 = xor i64 %187, %191 - store i64 %192, ptr %186, align 4 - %193 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %184 - %194 = load i64, ptr %193, align 4 - tail call void @___dec_future_refcount(i64 %194) - br label %cond_exit_548.thread.4.i.i - -cond_exit_548.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_548.thread.3.i.i - %195 = add i64 %"545_1.sroa.10.0.i.i", 5 - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_548.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_548.thread.4.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %198, %202 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_548.thread.5.i.i - -cond_exit_548.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_548.thread.4.i.i - %206 = add i64 %"545_1.sroa.10.0.i.i", 6 - %207 = lshr i64 %206, 6 - %208 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %207 - %209 = load i64, ptr %208, align 4 - %210 = and i64 %206, 63 - %211 = lshr i64 %209, %210 - %212 = trunc i64 %211 to i1 - br i1 %212, label %cond_exit_548.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_548.thread.5.i.i - %213 = shl nuw i64 1, %210 - %214 = xor i64 %209, %213 - store i64 %214, ptr %208, align 4 - %215 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %206 - %216 = load i64, ptr %215, align 4 - tail call void @___dec_future_refcount(i64 %216) - br label %cond_exit_548.thread.6.i.i - -cond_exit_548.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_548.thread.5.i.i - %217 = add i64 %"545_1.sroa.10.0.i.i", 7 - %218 = lshr i64 %217, 6 - %219 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %218 - %220 = load i64, ptr %219, align 4 - %221 = and i64 %217, 63 - %222 = lshr i64 %220, %221 - %223 = trunc i64 %222 to i1 - br i1 %223, label %cond_exit_548.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_548.thread.6.i.i - %224 = shl nuw i64 1, %221 - %225 = xor i64 %220, %224 - store i64 %225, ptr %219, align 4 - %226 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %217 - %227 = load i64, ptr %226, align 4 - tail call void @___dec_future_refcount(i64 %227) - br label %cond_exit_548.thread.7.i.i - -cond_exit_548.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_548.thread.6.i.i - %228 = add i64 %"545_1.sroa.10.0.i.i", 8 - %229 = lshr i64 %228, 6 - %230 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %229 - %231 = load i64, ptr %230, align 4 - %232 = and i64 %228, 63 - %233 = lshr i64 %231, %232 - %234 = trunc i64 %233 to i1 - br i1 %234, label %cond_exit_548.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_548.thread.7.i.i - %235 = shl nuw i64 1, %232 - %236 = xor i64 %231, %235 - store i64 %236, ptr %230, align 4 - %237 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %228 - %238 = load i64, ptr %237, align 4 - tail call void @___dec_future_refcount(i64 %238) - br label %cond_exit_548.thread.8.i.i - -cond_exit_548.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_548.thread.7.i.i - %239 = add i64 %"545_1.sroa.10.0.i.i", 9 - %240 = lshr i64 %239, 6 - %241 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %240 - %242 = load i64, ptr %241, align 4 - %243 = and i64 %239, 63 - %244 = lshr i64 %242, %243 - %245 = trunc i64 %244 to i1 - br i1 %245, label %cond_exit_548.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_548.thread.8.i.i - %246 = shl nuw i64 1, %243 - %247 = xor i64 %242, %246 - store i64 %247, ptr %241, align 4 - %248 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %239 - %249 = load i64, ptr %248, align 4 - tail call void @___dec_future_refcount(i64 %249) - br label %cond_exit_548.thread.9.i.i - -cond_exit_548.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_548.thread.8.i.i - %250 = load i64, ptr %122, align 4 - %251 = sub nuw nsw i64 64, %124 - %252 = lshr i64 -1, %251 - %253 = icmp eq i64 %124, 0 - %254 = select i1 %253, i64 0, i64 %252 - %255 = or i64 %250, %254 - store i64 %255, ptr %122, align 4 - %256 = load i64, ptr %241, align 4 - %257 = shl nsw i64 -2, %243 - %258 = icmp eq i64 %243, 63 - %259 = select i1 %258, i64 0, i64 %257 - %260 = or i64 %256, %259 - store i64 %260, ptr %241, align 4 - %reass.sub.i.i.i703 = sub nsw i64 %240, %121 - %.not.i.i.i704 = icmp eq i64 %reass.sub.i.i.i703, -1 - br i1 %.not.i.i.i704, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %261 = xor i64 %140, %136 - store i64 %261, ptr %131, align 4 - store i64 %139, ptr %138, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %139) - tail call void @___dec_future_refcount(i64 %139) - %262 = load i64, ptr %120, align 4 - %263 = lshr i64 %262, %"280_0.sroa.15.0168.i" - %264 = trunc i64 %263 to i1 - br i1 %264, label %loop_body.i701, label %panic.i.i700 - -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %265 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %128, 1 - %266 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %267 = xor i64 %262, %266 - store i64 %267, ptr %120, align 4 - %268 = getelementptr inbounds nuw i1, ptr %119, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %268, align 1 - %269 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %128, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %143, %cond_exit_548.thread.9.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %270 = load i64, ptr %120, align 4 - %271 = and i64 %270, 1023 - store i64 %271, ptr %120, align 4 - %272 = icmp eq i64 %271, 0 - br i1 %272, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %273 = tail call ptr @heap_alloc(i64 10) - %274 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %274, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %273, ptr noundef nonnull align 1 dereferenceable(10) %119, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %273) - %275 = load i64, ptr %120, align 4 - %276 = and i64 %275, 1023 - store i64 %276, ptr %120, align 4 - %277 = icmp eq i64 %276, 0 - br i1 %277, label %__barray_check_none_borrowed.exit719, label %mask_block_err.i717 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %112 = or disjoint i64 %165, 1 + store i64 %112, ptr %3, align 4 + %113 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %113) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not1732 = icmp eq i64 %115, 0 + br i1 %.not1732, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %116 = or disjoint i64 %114, 2 + store i64 %116, ptr %3, align 4 + %117 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %118 = load i64, ptr %117, align 4 + tail call void @___dec_future_refcount(i64 %118) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %119 = load i64, ptr %3, align 4 + %120 = and i64 %119, 4 + %.not1733 = icmp eq i64 %120, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %121 = or disjoint i64 %119, 4 + store i64 %121, ptr %3, align 4 + %122 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %123 = load i64, ptr %122, align 4 + tail call void @___dec_future_refcount(i64 %123) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %124 = load i64, ptr %3, align 4 + %125 = and i64 %124, 8 + %.not1734 = icmp eq i64 %125, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %3, align 4 + %127 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %128 = load i64, ptr %127, align 4 + tail call void @___dec_future_refcount(i64 %128) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %129 = load i64, ptr %3, align 4 + %130 = and i64 %129, 16 + %.not1735 = icmp eq i64 %130, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %131 = or disjoint i64 %129, 16 + store i64 %131, ptr %3, align 4 + %132 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %133 = load i64, ptr %132, align 4 + tail call void @___dec_future_refcount(i64 %133) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %134 = load i64, ptr %3, align 4 + %135 = and i64 %134, 32 + %.not1736 = icmp eq i64 %135, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %136 = or disjoint i64 %134, 32 + store i64 %136, ptr %3, align 4 + %137 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %138 = load i64, ptr %137, align 4 + tail call void @___dec_future_refcount(i64 %138) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %139 = load i64, ptr %3, align 4 + %140 = and i64 %139, 64 + %.not1737 = icmp eq i64 %140, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %141 = or disjoint i64 %139, 64 + store i64 %141, ptr %3, align 4 + %142 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %143 = load i64, ptr %142, align 4 + tail call void @___dec_future_refcount(i64 %143) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %144 = load i64, ptr %3, align 4 + %145 = and i64 %144, 128 + %.not1738 = icmp eq i64 %145, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %146 = or disjoint i64 %144, 128 + store i64 %146, ptr %3, align 4 + %147 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %148 = load i64, ptr %147, align 4 + tail call void @___dec_future_refcount(i64 %148) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %149 = load i64, ptr %3, align 4 + %150 = and i64 %149, 256 + %.not1739 = icmp eq i64 %150, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %151 = or disjoint i64 %149, 256 + store i64 %151, ptr %3, align 4 + %152 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %153 = load i64, ptr %152, align 4 + tail call void @___dec_future_refcount(i64 %153) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %154 = load i64, ptr %3, align 4 + %155 = and i64 %154, 512 + %.not1740 = icmp eq i64 %155, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %156 = or disjoint i64 %154, 512 + store i64 %156, ptr %3, align 4 + %157 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %158 = load i64, ptr %157, align 4 + tail call void @___dec_future_refcount(i64 %158) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %159 = load i64, ptr %3, align 4 + %160 = or i64 %159, -1024 + store i64 %160, ptr %3, align 4 + %161 = icmp eq i64 %160, -1 + br i1 %161, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %162 = xor i64 %109, %101 + store i64 %162, ptr %1, align 4 + %163 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %163, align 1 + %164 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %164, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %165 = load i64, ptr %3, align 4 + %166 = trunc i64 %165 to i1 + br i1 %166, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %167 = load i64, ptr %1, align 4 + %168 = and i64 %167, 1023 + store i64 %168, ptr %1, align 4 + %169 = icmp eq i64 %168, 0 + br i1 %169, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %170 = tail call ptr @heap_alloc(i64 10) + %171 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %171, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %170, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %170) + %172 = load i64, ptr %1, align 4 + %173 = and i64 %172, 1023 + store i64 %173, ptr %1, align 4 + %174 = icmp eq i64 %173, 0 + br i1 %174, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit719: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %278 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %278, i8 0, i64 10, i1 false) + %175 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %175, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %119, ptr %arr_ptr, align 8 - store ptr %278, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %175, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit727 + br label %__barray_check_bounds.exit1657 -mask_block_err.i717: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit727: ; preds = %cond_exit_94, %__barray_check_none_borrowed.exit719 - %"89_0.sroa.0.0777" = phi i64 [ 0, %__barray_check_none_borrowed.exit719 ], [ %285, %cond_exit_94 ] - %279 = lshr i64 %"89_0.sroa.0.0777", 6 - %280 = getelementptr inbounds nuw i64, ptr %3, i64 %279 - %281 = load i64, ptr %280, align 4 - %282 = and i64 %"89_0.sroa.0.0777", 63 - %283 = lshr i64 %281, %282 - %284 = trunc i64 %283 to i1 - br i1 %284, label %cond_exit_94, label %panic.i728 - -panic.i728: ; preds = %__barray_check_bounds.exit727 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %182, %cond_exit_147 ] + %176 = lshr i64 %"143_2.01709", 6 + %177 = getelementptr inbounds nuw i64, ptr %7, i64 %176 + %178 = load i64, ptr %177, align 4 + %179 = and i64 %"143_2.01709", 63 + %180 = lshr i64 %178, %179 + %181 = trunc i64 %180 to i1 + br i1 %181, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit727 - %285 = add nuw nsw i64 %"89_0.sroa.0.0777", 1 - %286 = shl nuw i64 1, %282 - %287 = xor i64 %281, %286 - store i64 %287, ptr %280, align 4 - %288 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0777" - store i64 %"89_0.sroa.0.0777", ptr %288, align 4 - %exitcond.not = icmp eq i64 %285, 100 - br i1 %exitcond.not, label %loop_out127, label %__barray_check_bounds.exit727 - -loop_out127: ; preds = %cond_exit_94 - %289 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %290 = load i64, ptr %289, align 4 - %291 = and i64 %290, 68719476735 - store i64 %291, ptr %289, align 4 - %292 = load i64, ptr %3, align 4 - %293 = icmp eq i64 %292, 0 - %294 = icmp eq i64 %291, 0 - %or.cond = select i1 %293, i1 %294, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit734, label %mask_block_err.i732 - -__barray_check_none_borrowed.exit734: ; preds = %loop_out127 - %295 = call ptr @heap_alloc(i64 800) - %296 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %296, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %295, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %295) - %297 = load i64, ptr %289, align 4 - %298 = and i64 %297, 68719476735 - store i64 %298, ptr %289, align 4 - %299 = load i64, ptr %3, align 4 - %300 = icmp eq i64 %299, 0 - %301 = icmp eq i64 %298, 0 - %or.cond790 = select i1 %300, i1 %301, i1 false - br i1 %or.cond790, label %__barray_check_none_borrowed.exit739, label %mask_block_err.i737 - -mask_block_err.i732: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %182 = add nuw nsw i64 %"143_2.01709", 1 + %183 = shl nuw i64 1, %179 + %184 = xor i64 %178, %183 + store i64 %184, ptr %177, align 4 + %185 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %185, align 4 + %exitcond = icmp eq i64 %182, 100 + br i1 %exitcond, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147 + %186 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %187 = load i64, ptr %186, align 4 + %188 = and i64 %187, 68719476735 + store i64 %188, ptr %186, align 4 + %189 = load i64, ptr %7, align 4 + %190 = icmp eq i64 %189, 0 + %191 = icmp eq i64 %188, 0 + %or.cond = select i1 %190, i1 %191, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %192 = call ptr @heap_alloc(i64 800) + %193 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %193, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %192, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %192) + %194 = load i64, ptr %186, align 4 + %195 = and i64 %194, 68719476735 + store i64 %195, ptr %186, align 4 + %196 = load i64, ptr %7, align 4 + %197 = icmp eq i64 %196, 0 + %198 = icmp eq i64 %195, 0 + %or.cond1726 = select i1 %197, i1 %198, i1 false + br i1 %or.cond1726, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit739: ; preds = %__barray_check_none_borrowed.exit734 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %302 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %302, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %302, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit747 - -mask_block_err.i737: ; preds = %__barray_check_none_borrowed.exit734 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %199 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %199, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %199, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit747: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit739 - %"124_0.sroa.0.0779" = phi i64 [ 0, %__barray_check_none_borrowed.exit739 ], [ %311, %cond_exit_129 ] - %303 = lshr i64 %"124_0.sroa.0.0779", 6 - %304 = getelementptr inbounds nuw i64, ptr %1, i64 %303 - %305 = load i64, ptr %304, align 4 - %306 = and i64 %"124_0.sroa.0.0779", 63 - %307 = lshr i64 %305, %306 - %308 = trunc i64 %307 to i1 - br i1 %308, label %cond_exit_129, label %panic.i748 - -panic.i748: ; preds = %__barray_check_bounds.exit747 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %208, %cond_exit_253 ] + %200 = lshr i64 %"249_2.01711", 6 + %201 = getelementptr inbounds nuw i64, ptr %5, i64 %200 + %202 = load i64, ptr %201, align 4 + %203 = and i64 %"249_2.01711", 63 + %204 = lshr i64 %202, %203 + %205 = trunc i64 %204 to i1 + br i1 %205, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit747 - %309 = uitofp nneg i64 %"124_0.sroa.0.0779" to double - %310 = fmul double %309, 6.250000e-02 - %311 = add nuw nsw i64 %"124_0.sroa.0.0779", 1 - %312 = shl nuw i64 1, %306 - %313 = xor i64 %305, %312 - store i64 %313, ptr %304, align 4 - %314 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0779" - store double %310, ptr %314, align 8 - %exitcond780.not = icmp eq i64 %311, 100 - br i1 %exitcond780.not, label %loop_out211, label %__barray_check_bounds.exit747 - -loop_out211: ; preds = %cond_exit_129 - %315 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %316 = load i64, ptr %315, align 4 - %317 = and i64 %316, 68719476735 - store i64 %317, ptr %315, align 4 - %318 = load i64, ptr %1, align 4 - %319 = icmp eq i64 %318, 0 - %320 = icmp eq i64 %317, 0 - %or.cond791 = select i1 %319, i1 %320, i1 false - br i1 %or.cond791, label %__barray_check_none_borrowed.exit754, label %mask_block_err.i752 - -__barray_check_none_borrowed.exit754: ; preds = %loop_out211 - %321 = call ptr @heap_alloc(i64 800) - %322 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %322, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %321, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %321) - %323 = load i64, ptr %315, align 4 - %324 = and i64 %323, 68719476735 - store i64 %324, ptr %315, align 4 - %325 = load i64, ptr %1, align 4 - %326 = icmp eq i64 %325, 0 - %327 = icmp eq i64 %324, 0 - %or.cond792 = select i1 %326, i1 %327, i1 false - br i1 %or.cond792, label %__barray_check_none_borrowed.exit759, label %mask_block_err.i757 - -mask_block_err.i752: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %206 = uitofp nneg i64 %"249_2.01711" to double + %207 = fmul double %206, 6.250000e-02 + %208 = add nuw nsw i64 %"249_2.01711", 1 + %209 = shl nuw i64 1, %203 + %210 = xor i64 %202, %209 + store i64 %210, ptr %201, align 4 + %211 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %207, ptr %211, align 8 + %exitcond1713 = icmp eq i64 %208, 100 + br i1 %exitcond1713, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %212 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %213 = load i64, ptr %212, align 4 + %214 = and i64 %213, 68719476735 + store i64 %214, ptr %212, align 4 + %215 = load i64, ptr %5, align 4 + %216 = icmp eq i64 %215, 0 + %217 = icmp eq i64 %214, 0 + %or.cond1727 = select i1 %216, i1 %217, i1 false + br i1 %or.cond1727, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %218 = call ptr @heap_alloc(i64 800) + %219 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %219, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %218, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %218) + %220 = load i64, ptr %212, align 4 + %221 = and i64 %220, 68719476735 + store i64 %221, ptr %212, align 4 + %222 = load i64, ptr %5, align 4 + %223 = icmp eq i64 %222, 0 + %224 = icmp eq i64 %221, 0 + %or.cond1728 = select i1 %223, i1 %224, i1 false + br i1 %or.cond1728, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit759: ; preds = %__barray_check_none_borrowed.exit754 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %328 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %328, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %328, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %225 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %225, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %225, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i757: ; preds = %__barray_check_none_borrowed.exit754 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -895,26 +766,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-apple-darwin.ll index 36a241eb..9fba0962 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-apple-darwin.ll @@ -3,750 +3,775 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__barray_check_bounds.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not786 = icmp eq i64 %10, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1724 = icmp eq i64 %14, 0 + br i1 %.not1724, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not787 = icmp eq i64 %14, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1725 = icmp eq i64 %18, 0 + br i1 %.not1725, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not788 = icmp eq i64 %18, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1726 = icmp eq i64 %22, 0 + br i1 %.not1726, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not789 = icmp eq i64 %22, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1727 = icmp eq i64 %26, 0 + br i1 %.not1727, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not790 = icmp eq i64 %26, 0 - br i1 %.not790, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1728 = icmp eq i64 %30, 0 + br i1 %.not1728, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not791 = icmp eq i64 %30, 0 - br i1 %.not791, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1729 = icmp eq i64 %34, 0 + br i1 %.not1729, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not792 = icmp eq i64 %34, 0 - br i1 %.not792, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1730 = icmp eq i64 %38, 0 + br i1 %.not1730, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not793 = icmp eq i64 %38, 0 - br i1 %.not793, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1731 = icmp eq i64 %42, 0 + br i1 %.not1731, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not794 = icmp eq i64 %42, 0 - br i1 %.not794, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1732 = icmp eq i64 %46, 0 + br i1 %.not1732, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %56 = load i64, ptr %55, align 4 - tail call void @___rxy(i64 %56, double 0x400921FB54442D18, double 0.000000e+00) - %57 = load i64, ptr %5, align 4 - %58 = and i64 %57, 4 - %.not770 = icmp eq i64 %58, 0 - br i1 %.not770, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %60 = load i64, ptr %59, align 4 + tail call void @___rxy(i64 %60, double 0x400921FB54442D18, double 0.000000e+00) + %61 = load i64, ptr %9, align 4 + %62 = and i64 %61, 4 + %.not1701 = icmp eq i64 %62, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %59 = and i64 %57, -5 - store i64 %59, ptr %5, align 4 - store i64 %56, ptr %55, align 4 - %60 = load i64, ptr %5, align 4 - %61 = and i64 %60, 8 - %.not771 = icmp eq i64 %61, 0 - br i1 %.not771, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %63 = and i64 %61, -5 + store i64 %63, ptr %9, align 4 + store i64 %60, ptr %59, align 4 + %64 = load i64, ptr %9, align 4 + %65 = and i64 %64, 8 + %.not1702 = icmp eq i64 %65, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %62 = or disjoint i64 %60, 8 - store i64 %62, ptr %5, align 4 - %63 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %64 = load i64, ptr %63, align 4 - tail call void @___rxy(i64 %64, double 0x400921FB54442D18, double 0.000000e+00) - %65 = load i64, ptr %5, align 4 - %66 = and i64 %65, 8 - %.not772 = icmp eq i64 %66, 0 - br i1 %.not772, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %66 = or disjoint i64 %64, 8 + store i64 %66, ptr %9, align 4 + %67 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %68 = load i64, ptr %67, align 4 + tail call void @___rxy(i64 %68, double 0x400921FB54442D18, double 0.000000e+00) + %69 = load i64, ptr %9, align 4 + %70 = and i64 %69, 8 + %.not1703 = icmp eq i64 %70, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %67 = and i64 %65, -9 - store i64 %67, ptr %5, align 4 - store i64 %64, ptr %63, align 4 - %68 = load i64, ptr %5, align 4 - %69 = and i64 %68, 512 - %.not773 = icmp eq i64 %69, 0 - br i1 %.not773, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %71 = and i64 %69, -9 + store i64 %71, ptr %9, align 4 + store i64 %68, ptr %67, align 4 + %72 = load i64, ptr %9, align 4 + %73 = and i64 %72, 512 + %.not1704 = icmp eq i64 %73, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %70 = or disjoint i64 %68, 512 - store i64 %70, ptr %5, align 4 - %71 = getelementptr inbounds nuw i8, ptr %4, i64 72 - %72 = load i64, ptr %71, align 4 - tail call void @___rxy(i64 %72, double 0x400921FB54442D18, double 0.000000e+00) - %73 = load i64, ptr %5, align 4 - %74 = and i64 %73, 512 - %.not774 = icmp eq i64 %74, 0 - br i1 %.not774, label %panic.i696, label %__barray_mask_return.exit697 - -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %74 = or disjoint i64 %72, 512 + store i64 %74, ptr %9, align 4 + %75 = getelementptr inbounds nuw i8, ptr %8, i64 72 + %76 = load i64, ptr %75, align 4 + tail call void @___rxy(i64 %76, double 0x400921FB54442D18, double 0.000000e+00) + %77 = load i64, ptr %9, align 4 + %78 = and i64 %77, 512 + %.not1705 = icmp eq i64 %78, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %75 = and i64 %73, -513 - store i64 %75, ptr %5, align 4 - store i64 %72, ptr %71, align 4 - %76 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %77 = tail call ptr @heap_alloc(i64 80) - %78 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %78, align 1 - br label %__barray_check_bounds.exit.i.i - -79: ; preds = %loop_body.i - %80 = lshr i64 %.fca.2.extract.i.i, 6 - %81 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %.fca.2.extract.i.i, 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %89 = lshr i64 %last_valid.i.i.i, 6 - %90 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i = sub nsw i64 %89, %80 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -97: ; preds = %mask_block_ok.i.i.i - %98 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %79, %97 - %.02.i.i.i = phi i64 [ %98, %97 ], [ 0, %79 ] - %gep.i.i.i = getelementptr i64, ptr %81, i64 %.02.i.i.i - %99 = load i64, ptr %gep.i.i.i, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %79 = and i64 %77, -513 + store i64 %79, ptr %9, align 4 + store i64 %76, ptr %75, align 4 + br label %__barray_check_bounds.exit1620 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %101, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %76, %__barray_mask_return.exit697 ], [ %116, %loop_body.i ] - %101 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %102 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %102 - %112 = load i64, ptr %111, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %78, align 4 - %114 = lshr i64 %113, %"239_0.sroa.15.0178.i" - %115 = trunc i64 %114 to i1 - br i1 %115, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1616: ; preds = %.thread + %80 = load i64, ptr %3, align 4 + %81 = lshr i64 %80, %"363_2.01721" + %82 = trunc i64 %81 to i1 + br i1 %82, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %116 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %101, 1 - %117 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %118 = xor i64 %113, %117 - store i64 %118, ptr %78, align 4 - %119 = getelementptr inbounds nuw i64, ptr %77, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %119, align 4 - %120 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %120, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %120, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %120, 2 - %exitcond.not.i = icmp eq i64 %101, 10 - br i1 %exitcond.not.i, label %79, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %97, %79 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %77, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %78, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %121 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %122 = tail call ptr @heap_alloc(i64 10) - %123 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %123, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %181, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %125, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %121, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %177, %loop_body.i701 ] - %125 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i714, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i714: ; preds = %__barray_check_bounds.exit.i.i698 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_ok.i: ; preds = %cond_exit_367 + %83 = load i64, ptr %9, align 4 + %84 = or i64 %83, -1024 + store i64 %84, ptr %9, align 4 + %85 = icmp eq i64 %84, -1 + br i1 %85, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01722" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %86, %cond_exit_367 ] + %"363_2.01721" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %94, %cond_exit_367 ] + %86 = add nuw nsw i64 %"363_0.sroa.15.01722", 1 + %87 = load i64, ptr %9, align 4 + %88 = lshr i64 %87, %"363_0.sroa.15.01722" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1621, label %.thread -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_548_case_0.i.i: ; preds = %cond_exit_548.thread.i.i - %140 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %141 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %140 - %142 = load i64, ptr %141, align 4 - %143 = and i64 %"545_1.sroa.10.0.i.i", 63 - %144 = sub nuw nsw i64 64, %143 - %145 = lshr i64 -1, %144 - %146 = icmp eq i64 %143, 0 - %147 = select i1 %146, i64 0, i64 %145 - %148 = or i64 %142, %147 - store i64 %148, ptr %141, align 4 - %last_valid.i.i.i703 = add i64 %"545_1.sroa.10.0.i.i", 9 - %149 = lshr i64 %last_valid.i.i.i703, 6 - %150 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %last_valid.i.i.i703, 63 - %153 = shl nsw i64 -2, %152 - %154 = icmp eq i64 %152, 63 - %155 = select i1 %154, i64 0, i64 %153 - %156 = or i64 %151, %155 - store i64 %156, ptr %150, align 4 - %reass.sub.i.i.i704 = sub nsw i64 %149, %140 - %.not.i.i.i705 = icmp eq i64 %reass.sub.i.i.i704, -1 - br i1 %.not.i.i.i705, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -157: ; preds = %mask_block_ok.i.i.i706 - %158 = add nuw i64 %.02.i.i.i707, 1 - %exitcond.not.i.i.i710 = icmp eq i64 %.02.i.i.i707, %reass.sub.i.i.i704 - br i1 %exitcond.not.i.i.i710, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -mask_block_ok.i.i.i706: ; preds = %cond_548_case_0.i.i, %157 - %.02.i.i.i707 = phi i64 [ %158, %157 ], [ 0, %cond_548_case_0.i.i ] - %gep.i.i.i708 = getelementptr i64, ptr %141, i64 %.02.i.i.i707 - %159 = load i64, ptr %gep.i.i.i708, align 4 - %160 = icmp eq i64 %159, -1 - br i1 %160, label %157, label %mask_block_err.i.i.i709 - -mask_block_err.i.i.i709: ; preds = %mask_block_ok.i.i.i706 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +.thread: ; preds = %__barray_check_bounds.exit1620 + %90 = shl nuw nsw i64 1, %"363_0.sroa.15.01722" + %91 = xor i64 %87, %90 + store i64 %91, ptr %9, align 4 + %92 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01722" + %93 = load i64, ptr %92, align 4 + %94 = add i64 %"363_2.01721", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %93) + tail call void @___qfree(i64 %93) + %95 = icmp ult i64 %"363_2.01721", 10 + br i1 %95, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %96 = shl nuw nsw i64 1, %"363_2.01721" + %97 = xor i64 %80, %96 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01721" + store i64 %lazy_measure, ptr %98, align 4 + %99 = icmp samesign ugt i64 %"363_0.sroa.15.01722", 8 + br i1 %99, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %100, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %100 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %101 = load i64, ptr %3, align 4 + %102 = lshr i64 %101, %"429_0.sroa.15.01708" + %103 = trunc i64 %102 to i1 + br i1 %103, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_548.thread.i.i, %loop_body.preheader.i.i - %"545_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %161, %cond_exit_548.thread.i.i ] - %161 = add nuw nsw i64 %"545_0.0239.i.i", 1 - %162 = add i64 %"545_0.0239.i.i", %"545_1.sroa.10.0.i.i" - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %169, %165 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %161, 10 - br i1 %exitcond.i.i, label %cond_548_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %173 = xor i64 %137, %133 - store i64 %173, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - %174 = load i64, ptr %123, align 4 - %175 = lshr i64 %174, %"280_0.sroa.15.0168.i" - %176 = trunc i64 %175 to i1 - br i1 %176, label %loop_body.i701, label %panic.i.i700 +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %104 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %105 = xor i64 %101, %104 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %107 = load i64, ptr %106, align 4 + tail call void @___inc_future_refcount(i64 %107) + %108 = load i64, ptr %3, align 4 + %109 = lshr i64 %108, %"429_0.sroa.15.01708" + %110 = trunc i64 %109 to i1 + br i1 %110, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %111 = xor i64 %108, %104 + store i64 %111, ptr %3, align 4 + store i64 %107, ptr %106, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %107) + tail call void @___dec_future_refcount(i64 %107) + %112 = load i64, ptr %1, align 4 + %113 = lshr i64 %112, %"429_0.sroa.15.01708" + %114 = trunc i64 %113 to i1 + br i1 %114, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %177 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %178 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %179 = xor i64 %174, %178 - store i64 %179, ptr %123, align 4 - %180 = getelementptr inbounds nuw i1, ptr %122, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %180, align 1 - %181 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %157, %cond_548_case_0.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %182 = load i64, ptr %123, align 4 - %183 = and i64 %182, 1023 - store i64 %183, ptr %123, align 4 - %184 = icmp eq i64 %183, 0 - br i1 %184, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %185 = tail call ptr @heap_alloc(i64 10) - %186 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %186, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %185, ptr noundef nonnull align 1 dereferenceable(10) %122, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %185) - %187 = load i64, ptr %123, align 4 - %188 = and i64 %187, 1023 - store i64 %188, ptr %123, align 4 - %189 = icmp eq i64 %188, 0 - br i1 %189, label %__barray_check_none_borrowed.exit720, label %mask_block_err.i718 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %115 = or disjoint i64 %168, 1 + store i64 %115, ptr %3, align 4 + %116 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 2 + %.not1733 = icmp eq i64 %118, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %119 = or disjoint i64 %117, 2 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 4 + %.not1734 = icmp eq i64 %123, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %124 = or disjoint i64 %122, 4 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 8 + %.not1735 = icmp eq i64 %128, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %129 = or disjoint i64 %127, 8 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 16 + %.not1736 = icmp eq i64 %133, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %134 = or disjoint i64 %132, 16 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 32 + %.not1737 = icmp eq i64 %138, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %139 = or disjoint i64 %137, 32 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 64 + %.not1738 = icmp eq i64 %143, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %144 = or disjoint i64 %142, 64 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 128 + %.not1739 = icmp eq i64 %148, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %149 = or disjoint i64 %147, 128 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 256 + %.not1740 = icmp eq i64 %153, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %154 = or disjoint i64 %152, 256 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %157 = load i64, ptr %3, align 4 + %158 = and i64 %157, 512 + %.not1741 = icmp eq i64 %158, 0 + br i1 %.not1741, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %159 = or disjoint i64 %157, 512 + store i64 %159, ptr %3, align 4 + %160 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %162 = load i64, ptr %3, align 4 + %163 = or i64 %162, -1024 + store i64 %163, ptr %3, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %165 = xor i64 %112, %104 + store i64 %165, ptr %1, align 4 + %166 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %166, align 1 + %167 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %167, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %168 = load i64, ptr %3, align 4 + %169 = trunc i64 %168 to i1 + br i1 %169, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %173 = tail call ptr @heap_alloc(i64 10) + %174 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %174, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %173) + %175 = load i64, ptr %1, align 4 + %176 = and i64 %175, 1023 + store i64 %176, ptr %1, align 4 + %177 = icmp eq i64 %176, 0 + br i1 %177, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit720: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %190 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %190, i8 0, i64 10, i1 false) + %178 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %178, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %122, ptr %arr_ptr, align 8 - store ptr %190, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %178, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit728 + br label %__barray_check_bounds.exit1657 -mask_block_err.i718: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit728: ; preds = %cond_exit_94.1, %__barray_check_none_borrowed.exit720 - %"89_0.sroa.0.0778" = phi i64 [ 0, %__barray_check_none_borrowed.exit720 ], [ %207, %cond_exit_94.1 ] - %191 = lshr i64 %"89_0.sroa.0.0778", 6 - %192 = getelementptr inbounds nuw i64, ptr %3, i64 %191 - %193 = load i64, ptr %192, align 4 - %194 = and i64 %"89_0.sroa.0.0778", 62 - %195 = lshr i64 %193, %194 - %196 = trunc i64 %195 to i1 - br i1 %196, label %cond_exit_94, label %panic.i729 - -panic.i729: ; preds = %cond_exit_94, %__barray_check_bounds.exit728 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147.1, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %195, %cond_exit_147.1 ] + %179 = lshr i64 %"143_2.01709", 6 + %180 = getelementptr inbounds nuw i64, ptr %7, i64 %179 + %181 = load i64, ptr %180, align 4 + %182 = and i64 %"143_2.01709", 62 + %183 = lshr i64 %181, %182 + %184 = trunc i64 %183 to i1 + br i1 %184, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %cond_exit_147, %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit728 - %197 = or disjoint i64 %"89_0.sroa.0.0778", 1 - %198 = shl nuw nsw i64 1, %194 - %199 = xor i64 %193, %198 - store i64 %199, ptr %192, align 4 - %200 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0778" - store i64 %"89_0.sroa.0.0778", ptr %200, align 4 - %201 = lshr i64 %"89_0.sroa.0.0778", 6 - %202 = getelementptr inbounds nuw i64, ptr %3, i64 %201 - %203 = load i64, ptr %202, align 4 - %204 = and i64 %197, 63 - %205 = lshr i64 %203, %204 - %206 = trunc i64 %205 to i1 - br i1 %206, label %cond_exit_94.1, label %panic.i729 - -cond_exit_94.1: ; preds = %cond_exit_94 - %207 = add nuw nsw i64 %"89_0.sroa.0.0778", 2 - %208 = shl nuw i64 1, %204 - %209 = xor i64 %203, %208 - store i64 %209, ptr %202, align 4 - %210 = getelementptr inbounds nuw i64, ptr %2, i64 %197 - store i64 %197, ptr %210, align 4 - %exitcond781.not.1 = icmp eq i64 %207, 100 - br i1 %exitcond781.not.1, label %loop_out127, label %__barray_check_bounds.exit728 - -loop_out127: ; preds = %cond_exit_94.1 - %211 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %212 = load i64, ptr %211, align 4 - %213 = and i64 %212, 68719476735 - store i64 %213, ptr %211, align 4 - %214 = load i64, ptr %3, align 4 - %215 = icmp eq i64 %214, 0 - %216 = icmp eq i64 %213, 0 - %or.cond = select i1 %215, i1 %216, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit735, label %mask_block_err.i733 - -__barray_check_none_borrowed.exit735: ; preds = %loop_out127 - %217 = call ptr @heap_alloc(i64 800) - %218 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %218, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %217, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %217) - %219 = load i64, ptr %211, align 4 - %220 = and i64 %219, 68719476735 - store i64 %220, ptr %211, align 4 - %221 = load i64, ptr %3, align 4 - %222 = icmp eq i64 %221, 0 - %223 = icmp eq i64 %220, 0 - %or.cond783 = select i1 %222, i1 %223, i1 false - br i1 %or.cond783, label %__barray_check_none_borrowed.exit740, label %mask_block_err.i738 - -mask_block_err.i733: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %185 = or disjoint i64 %"143_2.01709", 1 + %186 = shl nuw nsw i64 1, %182 + %187 = xor i64 %181, %186 + store i64 %187, ptr %180, align 4 + %188 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %188, align 4 + %189 = lshr i64 %"143_2.01709", 6 + %190 = getelementptr inbounds nuw i64, ptr %7, i64 %189 + %191 = load i64, ptr %190, align 4 + %192 = and i64 %185, 63 + %193 = lshr i64 %191, %192 + %194 = trunc i64 %193 to i1 + br i1 %194, label %cond_exit_147.1, label %panic.i1658 + +cond_exit_147.1: ; preds = %cond_exit_147 + %195 = add nuw nsw i64 %"143_2.01709", 2 + %196 = shl nuw i64 1, %192 + %197 = xor i64 %191, %196 + store i64 %197, ptr %190, align 4 + %198 = getelementptr inbounds nuw i64, ptr %6, i64 %185 + store i64 %185, ptr %198, align 4 + %exitcond1713.1 = icmp eq i64 %195, 100 + br i1 %exitcond1713.1, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147.1 + %199 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %200 = load i64, ptr %199, align 4 + %201 = and i64 %200, 68719476735 + store i64 %201, ptr %199, align 4 + %202 = load i64, ptr %7, align 4 + %203 = icmp eq i64 %202, 0 + %204 = icmp eq i64 %201, 0 + %or.cond = select i1 %203, i1 %204, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %205 = call ptr @heap_alloc(i64 800) + %206 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %206, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %205, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %205) + %207 = load i64, ptr %199, align 4 + %208 = and i64 %207, 68719476735 + store i64 %208, ptr %199, align 4 + %209 = load i64, ptr %7, align 4 + %210 = icmp eq i64 %209, 0 + %211 = icmp eq i64 %208, 0 + %or.cond1718 = select i1 %210, i1 %211, i1 false + br i1 %or.cond1718, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit740: ; preds = %__barray_check_none_borrowed.exit735 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %224 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %224, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %224, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit748 - -mask_block_err.i738: ; preds = %__barray_check_none_borrowed.exit735 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %212 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %212, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %212, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit748: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit740 - %"124_0.sroa.0.0780" = phi i64 [ 0, %__barray_check_none_borrowed.exit740 ], [ %233, %cond_exit_129 ] - %225 = lshr i64 %"124_0.sroa.0.0780", 6 - %226 = getelementptr inbounds nuw i64, ptr %1, i64 %225 - %227 = load i64, ptr %226, align 4 - %228 = and i64 %"124_0.sroa.0.0780", 63 - %229 = lshr i64 %227, %228 - %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_129, label %panic.i749 - -panic.i749: ; preds = %__barray_check_bounds.exit748 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %221, %cond_exit_253 ] + %213 = lshr i64 %"249_2.01711", 6 + %214 = getelementptr inbounds nuw i64, ptr %5, i64 %213 + %215 = load i64, ptr %214, align 4 + %216 = and i64 %"249_2.01711", 63 + %217 = lshr i64 %215, %216 + %218 = trunc i64 %217 to i1 + br i1 %218, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit748 - %231 = uitofp nneg i64 %"124_0.sroa.0.0780" to double - %232 = fmul double %231, 6.250000e-02 - %233 = add nuw nsw i64 %"124_0.sroa.0.0780", 1 - %234 = shl nuw i64 1, %228 - %235 = xor i64 %227, %234 - store i64 %235, ptr %226, align 4 - %236 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0780" - store double %232, ptr %236, align 8 - %exitcond782.not = icmp eq i64 %233, 100 - br i1 %exitcond782.not, label %loop_out211, label %__barray_check_bounds.exit748 - -loop_out211: ; preds = %cond_exit_129 - %237 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %238 = load i64, ptr %237, align 4 - %239 = and i64 %238, 68719476735 - store i64 %239, ptr %237, align 4 - %240 = load i64, ptr %1, align 4 - %241 = icmp eq i64 %240, 0 - %242 = icmp eq i64 %239, 0 - %or.cond784 = select i1 %241, i1 %242, i1 false - br i1 %or.cond784, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i753 - -__barray_check_none_borrowed.exit755: ; preds = %loop_out211 - %243 = call ptr @heap_alloc(i64 800) - %244 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %244, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %243, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %243) - %245 = load i64, ptr %237, align 4 - %246 = and i64 %245, 68719476735 - store i64 %246, ptr %237, align 4 - %247 = load i64, ptr %1, align 4 - %248 = icmp eq i64 %247, 0 - %249 = icmp eq i64 %246, 0 - %or.cond785 = select i1 %248, i1 %249, i1 false - br i1 %or.cond785, label %__barray_check_none_borrowed.exit760, label %mask_block_err.i758 - -mask_block_err.i753: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %219 = uitofp nneg i64 %"249_2.01711" to double + %220 = fmul double %219, 6.250000e-02 + %221 = add nuw nsw i64 %"249_2.01711", 1 + %222 = shl nuw i64 1, %216 + %223 = xor i64 %215, %222 + store i64 %223, ptr %214, align 4 + %224 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %220, ptr %224, align 8 + %exitcond1714 = icmp eq i64 %221, 100 + br i1 %exitcond1714, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %225 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %226 = load i64, ptr %225, align 4 + %227 = and i64 %226, 68719476735 + store i64 %227, ptr %225, align 4 + %228 = load i64, ptr %5, align 4 + %229 = icmp eq i64 %228, 0 + %230 = icmp eq i64 %227, 0 + %or.cond1719 = select i1 %229, i1 %230, i1 false + br i1 %or.cond1719, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %231 = call ptr @heap_alloc(i64 800) + %232 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %232, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %231, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %231) + %233 = load i64, ptr %225, align 4 + %234 = and i64 %233, 68719476735 + store i64 %234, ptr %225, align 4 + %235 = load i64, ptr %5, align 4 + %236 = icmp eq i64 %235, 0 + %237 = icmp eq i64 %234, 0 + %or.cond1720 = select i1 %236, i1 %237, i1 false + br i1 %or.cond1720, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit760: ; preds = %__barray_check_none_borrowed.exit755 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %250 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %250, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %250, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %238 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %238, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %238, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i758: ; preds = %__barray_check_none_borrowed.exit755 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -759,26 +784,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-unknown-linux-gnu.ll index 12dde13b..660d4c70 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-unknown-linux-gnu.ll @@ -3,750 +3,775 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__barray_check_bounds.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not786 = icmp eq i64 %10, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1724 = icmp eq i64 %14, 0 + br i1 %.not1724, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not787 = icmp eq i64 %14, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1725 = icmp eq i64 %18, 0 + br i1 %.not1725, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not788 = icmp eq i64 %18, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1726 = icmp eq i64 %22, 0 + br i1 %.not1726, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not789 = icmp eq i64 %22, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1727 = icmp eq i64 %26, 0 + br i1 %.not1727, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not790 = icmp eq i64 %26, 0 - br i1 %.not790, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1728 = icmp eq i64 %30, 0 + br i1 %.not1728, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not791 = icmp eq i64 %30, 0 - br i1 %.not791, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1729 = icmp eq i64 %34, 0 + br i1 %.not1729, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not792 = icmp eq i64 %34, 0 - br i1 %.not792, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1730 = icmp eq i64 %38, 0 + br i1 %.not1730, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not793 = icmp eq i64 %38, 0 - br i1 %.not793, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1731 = icmp eq i64 %42, 0 + br i1 %.not1731, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not794 = icmp eq i64 %42, 0 - br i1 %.not794, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1732 = icmp eq i64 %46, 0 + br i1 %.not1732, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %56 = load i64, ptr %55, align 4 - tail call void @___rxy(i64 %56, double 0x400921FB54442D18, double 0.000000e+00) - %57 = load i64, ptr %5, align 4 - %58 = and i64 %57, 4 - %.not770 = icmp eq i64 %58, 0 - br i1 %.not770, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %60 = load i64, ptr %59, align 4 + tail call void @___rxy(i64 %60, double 0x400921FB54442D18, double 0.000000e+00) + %61 = load i64, ptr %9, align 4 + %62 = and i64 %61, 4 + %.not1701 = icmp eq i64 %62, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %59 = and i64 %57, -5 - store i64 %59, ptr %5, align 4 - store i64 %56, ptr %55, align 4 - %60 = load i64, ptr %5, align 4 - %61 = and i64 %60, 8 - %.not771 = icmp eq i64 %61, 0 - br i1 %.not771, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %63 = and i64 %61, -5 + store i64 %63, ptr %9, align 4 + store i64 %60, ptr %59, align 4 + %64 = load i64, ptr %9, align 4 + %65 = and i64 %64, 8 + %.not1702 = icmp eq i64 %65, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %62 = or disjoint i64 %60, 8 - store i64 %62, ptr %5, align 4 - %63 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %64 = load i64, ptr %63, align 4 - tail call void @___rxy(i64 %64, double 0x400921FB54442D18, double 0.000000e+00) - %65 = load i64, ptr %5, align 4 - %66 = and i64 %65, 8 - %.not772 = icmp eq i64 %66, 0 - br i1 %.not772, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %66 = or disjoint i64 %64, 8 + store i64 %66, ptr %9, align 4 + %67 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %68 = load i64, ptr %67, align 4 + tail call void @___rxy(i64 %68, double 0x400921FB54442D18, double 0.000000e+00) + %69 = load i64, ptr %9, align 4 + %70 = and i64 %69, 8 + %.not1703 = icmp eq i64 %70, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %67 = and i64 %65, -9 - store i64 %67, ptr %5, align 4 - store i64 %64, ptr %63, align 4 - %68 = load i64, ptr %5, align 4 - %69 = and i64 %68, 512 - %.not773 = icmp eq i64 %69, 0 - br i1 %.not773, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %71 = and i64 %69, -9 + store i64 %71, ptr %9, align 4 + store i64 %68, ptr %67, align 4 + %72 = load i64, ptr %9, align 4 + %73 = and i64 %72, 512 + %.not1704 = icmp eq i64 %73, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %70 = or disjoint i64 %68, 512 - store i64 %70, ptr %5, align 4 - %71 = getelementptr inbounds nuw i8, ptr %4, i64 72 - %72 = load i64, ptr %71, align 4 - tail call void @___rxy(i64 %72, double 0x400921FB54442D18, double 0.000000e+00) - %73 = load i64, ptr %5, align 4 - %74 = and i64 %73, 512 - %.not774 = icmp eq i64 %74, 0 - br i1 %.not774, label %panic.i696, label %__barray_mask_return.exit697 - -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %74 = or disjoint i64 %72, 512 + store i64 %74, ptr %9, align 4 + %75 = getelementptr inbounds nuw i8, ptr %8, i64 72 + %76 = load i64, ptr %75, align 4 + tail call void @___rxy(i64 %76, double 0x400921FB54442D18, double 0.000000e+00) + %77 = load i64, ptr %9, align 4 + %78 = and i64 %77, 512 + %.not1705 = icmp eq i64 %78, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %75 = and i64 %73, -513 - store i64 %75, ptr %5, align 4 - store i64 %72, ptr %71, align 4 - %76 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %77 = tail call ptr @heap_alloc(i64 80) - %78 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %78, align 1 - br label %__barray_check_bounds.exit.i.i - -79: ; preds = %loop_body.i - %80 = lshr i64 %.fca.2.extract.i.i, 6 - %81 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %.fca.2.extract.i.i, 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %89 = lshr i64 %last_valid.i.i.i, 6 - %90 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i = sub nsw i64 %89, %80 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -97: ; preds = %mask_block_ok.i.i.i - %98 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %79, %97 - %.02.i.i.i = phi i64 [ %98, %97 ], [ 0, %79 ] - %gep.i.i.i = getelementptr i64, ptr %81, i64 %.02.i.i.i - %99 = load i64, ptr %gep.i.i.i, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %79 = and i64 %77, -513 + store i64 %79, ptr %9, align 4 + store i64 %76, ptr %75, align 4 + br label %__barray_check_bounds.exit1620 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %101, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %76, %__barray_mask_return.exit697 ], [ %116, %loop_body.i ] - %101 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %102 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %102 - %112 = load i64, ptr %111, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %78, align 4 - %114 = lshr i64 %113, %"239_0.sroa.15.0178.i" - %115 = trunc i64 %114 to i1 - br i1 %115, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1616: ; preds = %.thread + %80 = load i64, ptr %3, align 4 + %81 = lshr i64 %80, %"363_2.01721" + %82 = trunc i64 %81 to i1 + br i1 %82, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %116 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %101, 1 - %117 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %118 = xor i64 %113, %117 - store i64 %118, ptr %78, align 4 - %119 = getelementptr inbounds nuw i64, ptr %77, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %119, align 4 - %120 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %120, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %120, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %120, 2 - %exitcond.not.i = icmp eq i64 %101, 10 - br i1 %exitcond.not.i, label %79, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %97, %79 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %77, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %78, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %121 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %122 = tail call ptr @heap_alloc(i64 10) - %123 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %123, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %181, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %125, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %121, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %177, %loop_body.i701 ] - %125 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i714, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i714: ; preds = %__barray_check_bounds.exit.i.i698 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_ok.i: ; preds = %cond_exit_367 + %83 = load i64, ptr %9, align 4 + %84 = or i64 %83, -1024 + store i64 %84, ptr %9, align 4 + %85 = icmp eq i64 %84, -1 + br i1 %85, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01722" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %86, %cond_exit_367 ] + %"363_2.01721" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %94, %cond_exit_367 ] + %86 = add nuw nsw i64 %"363_0.sroa.15.01722", 1 + %87 = load i64, ptr %9, align 4 + %88 = lshr i64 %87, %"363_0.sroa.15.01722" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1621, label %.thread -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_548_case_0.i.i: ; preds = %cond_exit_548.thread.i.i - %140 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %141 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %140 - %142 = load i64, ptr %141, align 4 - %143 = and i64 %"545_1.sroa.10.0.i.i", 63 - %144 = sub nuw nsw i64 64, %143 - %145 = lshr i64 -1, %144 - %146 = icmp eq i64 %143, 0 - %147 = select i1 %146, i64 0, i64 %145 - %148 = or i64 %142, %147 - store i64 %148, ptr %141, align 4 - %last_valid.i.i.i703 = add i64 %"545_1.sroa.10.0.i.i", 9 - %149 = lshr i64 %last_valid.i.i.i703, 6 - %150 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %last_valid.i.i.i703, 63 - %153 = shl nsw i64 -2, %152 - %154 = icmp eq i64 %152, 63 - %155 = select i1 %154, i64 0, i64 %153 - %156 = or i64 %151, %155 - store i64 %156, ptr %150, align 4 - %reass.sub.i.i.i704 = sub nsw i64 %149, %140 - %.not.i.i.i705 = icmp eq i64 %reass.sub.i.i.i704, -1 - br i1 %.not.i.i.i705, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -157: ; preds = %mask_block_ok.i.i.i706 - %158 = add nuw i64 %.02.i.i.i707, 1 - %exitcond.not.i.i.i710 = icmp eq i64 %.02.i.i.i707, %reass.sub.i.i.i704 - br i1 %exitcond.not.i.i.i710, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -mask_block_ok.i.i.i706: ; preds = %cond_548_case_0.i.i, %157 - %.02.i.i.i707 = phi i64 [ %158, %157 ], [ 0, %cond_548_case_0.i.i ] - %gep.i.i.i708 = getelementptr i64, ptr %141, i64 %.02.i.i.i707 - %159 = load i64, ptr %gep.i.i.i708, align 4 - %160 = icmp eq i64 %159, -1 - br i1 %160, label %157, label %mask_block_err.i.i.i709 - -mask_block_err.i.i.i709: ; preds = %mask_block_ok.i.i.i706 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +.thread: ; preds = %__barray_check_bounds.exit1620 + %90 = shl nuw nsw i64 1, %"363_0.sroa.15.01722" + %91 = xor i64 %87, %90 + store i64 %91, ptr %9, align 4 + %92 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01722" + %93 = load i64, ptr %92, align 4 + %94 = add i64 %"363_2.01721", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %93) + tail call void @___qfree(i64 %93) + %95 = icmp ult i64 %"363_2.01721", 10 + br i1 %95, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %96 = shl nuw nsw i64 1, %"363_2.01721" + %97 = xor i64 %80, %96 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01721" + store i64 %lazy_measure, ptr %98, align 4 + %99 = icmp samesign ugt i64 %"363_0.sroa.15.01722", 8 + br i1 %99, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %100, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %100 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %101 = load i64, ptr %3, align 4 + %102 = lshr i64 %101, %"429_0.sroa.15.01708" + %103 = trunc i64 %102 to i1 + br i1 %103, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_548.thread.i.i, %loop_body.preheader.i.i - %"545_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %161, %cond_exit_548.thread.i.i ] - %161 = add nuw nsw i64 %"545_0.0239.i.i", 1 - %162 = add i64 %"545_0.0239.i.i", %"545_1.sroa.10.0.i.i" - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %169, %165 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %161, 10 - br i1 %exitcond.i.i, label %cond_548_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %173 = xor i64 %137, %133 - store i64 %173, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - %174 = load i64, ptr %123, align 4 - %175 = lshr i64 %174, %"280_0.sroa.15.0168.i" - %176 = trunc i64 %175 to i1 - br i1 %176, label %loop_body.i701, label %panic.i.i700 +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %104 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %105 = xor i64 %101, %104 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %107 = load i64, ptr %106, align 4 + tail call void @___inc_future_refcount(i64 %107) + %108 = load i64, ptr %3, align 4 + %109 = lshr i64 %108, %"429_0.sroa.15.01708" + %110 = trunc i64 %109 to i1 + br i1 %110, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %111 = xor i64 %108, %104 + store i64 %111, ptr %3, align 4 + store i64 %107, ptr %106, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %107) + tail call void @___dec_future_refcount(i64 %107) + %112 = load i64, ptr %1, align 4 + %113 = lshr i64 %112, %"429_0.sroa.15.01708" + %114 = trunc i64 %113 to i1 + br i1 %114, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %177 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %178 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %179 = xor i64 %174, %178 - store i64 %179, ptr %123, align 4 - %180 = getelementptr inbounds nuw i1, ptr %122, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %180, align 1 - %181 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %157, %cond_548_case_0.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %182 = load i64, ptr %123, align 4 - %183 = and i64 %182, 1023 - store i64 %183, ptr %123, align 4 - %184 = icmp eq i64 %183, 0 - br i1 %184, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %185 = tail call ptr @heap_alloc(i64 10) - %186 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %186, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %185, ptr noundef nonnull align 1 dereferenceable(10) %122, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %185) - %187 = load i64, ptr %123, align 4 - %188 = and i64 %187, 1023 - store i64 %188, ptr %123, align 4 - %189 = icmp eq i64 %188, 0 - br i1 %189, label %__barray_check_none_borrowed.exit720, label %mask_block_err.i718 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %115 = or disjoint i64 %168, 1 + store i64 %115, ptr %3, align 4 + %116 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 2 + %.not1733 = icmp eq i64 %118, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %119 = or disjoint i64 %117, 2 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 4 + %.not1734 = icmp eq i64 %123, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %124 = or disjoint i64 %122, 4 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 8 + %.not1735 = icmp eq i64 %128, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %129 = or disjoint i64 %127, 8 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 16 + %.not1736 = icmp eq i64 %133, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %134 = or disjoint i64 %132, 16 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 32 + %.not1737 = icmp eq i64 %138, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %139 = or disjoint i64 %137, 32 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 64 + %.not1738 = icmp eq i64 %143, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %144 = or disjoint i64 %142, 64 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 128 + %.not1739 = icmp eq i64 %148, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %149 = or disjoint i64 %147, 128 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 256 + %.not1740 = icmp eq i64 %153, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %154 = or disjoint i64 %152, 256 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %157 = load i64, ptr %3, align 4 + %158 = and i64 %157, 512 + %.not1741 = icmp eq i64 %158, 0 + br i1 %.not1741, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %159 = or disjoint i64 %157, 512 + store i64 %159, ptr %3, align 4 + %160 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %162 = load i64, ptr %3, align 4 + %163 = or i64 %162, -1024 + store i64 %163, ptr %3, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %165 = xor i64 %112, %104 + store i64 %165, ptr %1, align 4 + %166 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %166, align 1 + %167 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %167, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %168 = load i64, ptr %3, align 4 + %169 = trunc i64 %168 to i1 + br i1 %169, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %173 = tail call ptr @heap_alloc(i64 10) + %174 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %174, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %173) + %175 = load i64, ptr %1, align 4 + %176 = and i64 %175, 1023 + store i64 %176, ptr %1, align 4 + %177 = icmp eq i64 %176, 0 + br i1 %177, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit720: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %190 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %190, i8 0, i64 10, i1 false) + %178 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %178, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %122, ptr %arr_ptr, align 8 - store ptr %190, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %178, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit728 + br label %__barray_check_bounds.exit1657 -mask_block_err.i718: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit728: ; preds = %cond_exit_94.1, %__barray_check_none_borrowed.exit720 - %"89_0.sroa.0.0778" = phi i64 [ 0, %__barray_check_none_borrowed.exit720 ], [ %207, %cond_exit_94.1 ] - %191 = lshr i64 %"89_0.sroa.0.0778", 6 - %192 = getelementptr inbounds nuw i64, ptr %3, i64 %191 - %193 = load i64, ptr %192, align 4 - %194 = and i64 %"89_0.sroa.0.0778", 62 - %195 = lshr i64 %193, %194 - %196 = trunc i64 %195 to i1 - br i1 %196, label %cond_exit_94, label %panic.i729 - -panic.i729: ; preds = %cond_exit_94, %__barray_check_bounds.exit728 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147.1, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %195, %cond_exit_147.1 ] + %179 = lshr i64 %"143_2.01709", 6 + %180 = getelementptr inbounds nuw i64, ptr %7, i64 %179 + %181 = load i64, ptr %180, align 4 + %182 = and i64 %"143_2.01709", 62 + %183 = lshr i64 %181, %182 + %184 = trunc i64 %183 to i1 + br i1 %184, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %cond_exit_147, %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit728 - %197 = or disjoint i64 %"89_0.sroa.0.0778", 1 - %198 = shl nuw nsw i64 1, %194 - %199 = xor i64 %193, %198 - store i64 %199, ptr %192, align 4 - %200 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0778" - store i64 %"89_0.sroa.0.0778", ptr %200, align 4 - %201 = lshr i64 %"89_0.sroa.0.0778", 6 - %202 = getelementptr inbounds nuw i64, ptr %3, i64 %201 - %203 = load i64, ptr %202, align 4 - %204 = and i64 %197, 63 - %205 = lshr i64 %203, %204 - %206 = trunc i64 %205 to i1 - br i1 %206, label %cond_exit_94.1, label %panic.i729 - -cond_exit_94.1: ; preds = %cond_exit_94 - %207 = add nuw nsw i64 %"89_0.sroa.0.0778", 2 - %208 = shl nuw i64 1, %204 - %209 = xor i64 %203, %208 - store i64 %209, ptr %202, align 4 - %210 = getelementptr inbounds nuw i64, ptr %2, i64 %197 - store i64 %197, ptr %210, align 4 - %exitcond781.not.1 = icmp eq i64 %207, 100 - br i1 %exitcond781.not.1, label %loop_out127, label %__barray_check_bounds.exit728 - -loop_out127: ; preds = %cond_exit_94.1 - %211 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %212 = load i64, ptr %211, align 4 - %213 = and i64 %212, 68719476735 - store i64 %213, ptr %211, align 4 - %214 = load i64, ptr %3, align 4 - %215 = icmp eq i64 %214, 0 - %216 = icmp eq i64 %213, 0 - %or.cond = select i1 %215, i1 %216, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit735, label %mask_block_err.i733 - -__barray_check_none_borrowed.exit735: ; preds = %loop_out127 - %217 = call ptr @heap_alloc(i64 800) - %218 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %218, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %217, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %217) - %219 = load i64, ptr %211, align 4 - %220 = and i64 %219, 68719476735 - store i64 %220, ptr %211, align 4 - %221 = load i64, ptr %3, align 4 - %222 = icmp eq i64 %221, 0 - %223 = icmp eq i64 %220, 0 - %or.cond783 = select i1 %222, i1 %223, i1 false - br i1 %or.cond783, label %__barray_check_none_borrowed.exit740, label %mask_block_err.i738 - -mask_block_err.i733: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %185 = or disjoint i64 %"143_2.01709", 1 + %186 = shl nuw nsw i64 1, %182 + %187 = xor i64 %181, %186 + store i64 %187, ptr %180, align 4 + %188 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %188, align 4 + %189 = lshr i64 %"143_2.01709", 6 + %190 = getelementptr inbounds nuw i64, ptr %7, i64 %189 + %191 = load i64, ptr %190, align 4 + %192 = and i64 %185, 63 + %193 = lshr i64 %191, %192 + %194 = trunc i64 %193 to i1 + br i1 %194, label %cond_exit_147.1, label %panic.i1658 + +cond_exit_147.1: ; preds = %cond_exit_147 + %195 = add nuw nsw i64 %"143_2.01709", 2 + %196 = shl nuw i64 1, %192 + %197 = xor i64 %191, %196 + store i64 %197, ptr %190, align 4 + %198 = getelementptr inbounds nuw i64, ptr %6, i64 %185 + store i64 %185, ptr %198, align 4 + %exitcond1713.1 = icmp eq i64 %195, 100 + br i1 %exitcond1713.1, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147.1 + %199 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %200 = load i64, ptr %199, align 4 + %201 = and i64 %200, 68719476735 + store i64 %201, ptr %199, align 4 + %202 = load i64, ptr %7, align 4 + %203 = icmp eq i64 %202, 0 + %204 = icmp eq i64 %201, 0 + %or.cond = select i1 %203, i1 %204, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %205 = call ptr @heap_alloc(i64 800) + %206 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %206, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %205, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %205) + %207 = load i64, ptr %199, align 4 + %208 = and i64 %207, 68719476735 + store i64 %208, ptr %199, align 4 + %209 = load i64, ptr %7, align 4 + %210 = icmp eq i64 %209, 0 + %211 = icmp eq i64 %208, 0 + %or.cond1718 = select i1 %210, i1 %211, i1 false + br i1 %or.cond1718, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit740: ; preds = %__barray_check_none_borrowed.exit735 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %224 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %224, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %224, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit748 - -mask_block_err.i738: ; preds = %__barray_check_none_borrowed.exit735 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %212 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %212, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %212, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit748: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit740 - %"124_0.sroa.0.0780" = phi i64 [ 0, %__barray_check_none_borrowed.exit740 ], [ %233, %cond_exit_129 ] - %225 = lshr i64 %"124_0.sroa.0.0780", 6 - %226 = getelementptr inbounds nuw i64, ptr %1, i64 %225 - %227 = load i64, ptr %226, align 4 - %228 = and i64 %"124_0.sroa.0.0780", 63 - %229 = lshr i64 %227, %228 - %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_129, label %panic.i749 - -panic.i749: ; preds = %__barray_check_bounds.exit748 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %221, %cond_exit_253 ] + %213 = lshr i64 %"249_2.01711", 6 + %214 = getelementptr inbounds nuw i64, ptr %5, i64 %213 + %215 = load i64, ptr %214, align 4 + %216 = and i64 %"249_2.01711", 63 + %217 = lshr i64 %215, %216 + %218 = trunc i64 %217 to i1 + br i1 %218, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit748 - %231 = uitofp nneg i64 %"124_0.sroa.0.0780" to double - %232 = fmul double %231, 6.250000e-02 - %233 = add nuw nsw i64 %"124_0.sroa.0.0780", 1 - %234 = shl nuw i64 1, %228 - %235 = xor i64 %227, %234 - store i64 %235, ptr %226, align 4 - %236 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0780" - store double %232, ptr %236, align 8 - %exitcond782.not = icmp eq i64 %233, 100 - br i1 %exitcond782.not, label %loop_out211, label %__barray_check_bounds.exit748 - -loop_out211: ; preds = %cond_exit_129 - %237 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %238 = load i64, ptr %237, align 4 - %239 = and i64 %238, 68719476735 - store i64 %239, ptr %237, align 4 - %240 = load i64, ptr %1, align 4 - %241 = icmp eq i64 %240, 0 - %242 = icmp eq i64 %239, 0 - %or.cond784 = select i1 %241, i1 %242, i1 false - br i1 %or.cond784, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i753 - -__barray_check_none_borrowed.exit755: ; preds = %loop_out211 - %243 = call ptr @heap_alloc(i64 800) - %244 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %244, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %243, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %243) - %245 = load i64, ptr %237, align 4 - %246 = and i64 %245, 68719476735 - store i64 %246, ptr %237, align 4 - %247 = load i64, ptr %1, align 4 - %248 = icmp eq i64 %247, 0 - %249 = icmp eq i64 %246, 0 - %or.cond785 = select i1 %248, i1 %249, i1 false - br i1 %or.cond785, label %__barray_check_none_borrowed.exit760, label %mask_block_err.i758 - -mask_block_err.i753: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %219 = uitofp nneg i64 %"249_2.01711" to double + %220 = fmul double %219, 6.250000e-02 + %221 = add nuw nsw i64 %"249_2.01711", 1 + %222 = shl nuw i64 1, %216 + %223 = xor i64 %215, %222 + store i64 %223, ptr %214, align 4 + %224 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %220, ptr %224, align 8 + %exitcond1714 = icmp eq i64 %221, 100 + br i1 %exitcond1714, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %225 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %226 = load i64, ptr %225, align 4 + %227 = and i64 %226, 68719476735 + store i64 %227, ptr %225, align 4 + %228 = load i64, ptr %5, align 4 + %229 = icmp eq i64 %228, 0 + %230 = icmp eq i64 %227, 0 + %or.cond1719 = select i1 %229, i1 %230, i1 false + br i1 %or.cond1719, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %231 = call ptr @heap_alloc(i64 800) + %232 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %232, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %231, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %231) + %233 = load i64, ptr %225, align 4 + %234 = and i64 %233, 68719476735 + store i64 %234, ptr %225, align 4 + %235 = load i64, ptr %5, align 4 + %236 = icmp eq i64 %235, 0 + %237 = icmp eq i64 %234, 0 + %or.cond1720 = select i1 %236, i1 %237, i1 false + br i1 %or.cond1720, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit760: ; preds = %__barray_check_none_borrowed.exit755 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %250 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %250, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %250, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %238 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %238, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %238, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i758: ; preds = %__barray_check_none_borrowed.exit755 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -759,26 +784,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-windows-gnu.ll index 7dc625f6..23e421a7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-helios-x86_64-windows-gnu.ll @@ -3,750 +3,775 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__barray_check_bounds.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not786 = icmp eq i64 %10, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1724 = icmp eq i64 %14, 0 + br i1 %.not1724, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not787 = icmp eq i64 %14, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1725 = icmp eq i64 %18, 0 + br i1 %.not1725, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not788 = icmp eq i64 %18, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1726 = icmp eq i64 %22, 0 + br i1 %.not1726, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not789 = icmp eq i64 %22, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1727 = icmp eq i64 %26, 0 + br i1 %.not1727, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not790 = icmp eq i64 %26, 0 - br i1 %.not790, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1728 = icmp eq i64 %30, 0 + br i1 %.not1728, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not791 = icmp eq i64 %30, 0 - br i1 %.not791, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1729 = icmp eq i64 %34, 0 + br i1 %.not1729, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not792 = icmp eq i64 %34, 0 - br i1 %.not792, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1730 = icmp eq i64 %38, 0 + br i1 %.not1730, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not793 = icmp eq i64 %38, 0 - br i1 %.not793, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1731 = icmp eq i64 %42, 0 + br i1 %.not1731, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not794 = icmp eq i64 %42, 0 - br i1 %.not794, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1732 = icmp eq i64 %46, 0 + br i1 %.not1732, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %56 = load i64, ptr %55, align 4 - tail call void @___rxy(i64 %56, double 0x400921FB54442D18, double 0.000000e+00) - %57 = load i64, ptr %5, align 4 - %58 = and i64 %57, 4 - %.not770 = icmp eq i64 %58, 0 - br i1 %.not770, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %60 = load i64, ptr %59, align 4 + tail call void @___rxy(i64 %60, double 0x400921FB54442D18, double 0.000000e+00) + %61 = load i64, ptr %9, align 4 + %62 = and i64 %61, 4 + %.not1701 = icmp eq i64 %62, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %59 = and i64 %57, -5 - store i64 %59, ptr %5, align 4 - store i64 %56, ptr %55, align 4 - %60 = load i64, ptr %5, align 4 - %61 = and i64 %60, 8 - %.not771 = icmp eq i64 %61, 0 - br i1 %.not771, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %63 = and i64 %61, -5 + store i64 %63, ptr %9, align 4 + store i64 %60, ptr %59, align 4 + %64 = load i64, ptr %9, align 4 + %65 = and i64 %64, 8 + %.not1702 = icmp eq i64 %65, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %62 = or disjoint i64 %60, 8 - store i64 %62, ptr %5, align 4 - %63 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %64 = load i64, ptr %63, align 4 - tail call void @___rxy(i64 %64, double 0x400921FB54442D18, double 0.000000e+00) - %65 = load i64, ptr %5, align 4 - %66 = and i64 %65, 8 - %.not772 = icmp eq i64 %66, 0 - br i1 %.not772, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %66 = or disjoint i64 %64, 8 + store i64 %66, ptr %9, align 4 + %67 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %68 = load i64, ptr %67, align 4 + tail call void @___rxy(i64 %68, double 0x400921FB54442D18, double 0.000000e+00) + %69 = load i64, ptr %9, align 4 + %70 = and i64 %69, 8 + %.not1703 = icmp eq i64 %70, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %67 = and i64 %65, -9 - store i64 %67, ptr %5, align 4 - store i64 %64, ptr %63, align 4 - %68 = load i64, ptr %5, align 4 - %69 = and i64 %68, 512 - %.not773 = icmp eq i64 %69, 0 - br i1 %.not773, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %71 = and i64 %69, -9 + store i64 %71, ptr %9, align 4 + store i64 %68, ptr %67, align 4 + %72 = load i64, ptr %9, align 4 + %73 = and i64 %72, 512 + %.not1704 = icmp eq i64 %73, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %70 = or disjoint i64 %68, 512 - store i64 %70, ptr %5, align 4 - %71 = getelementptr inbounds nuw i8, ptr %4, i64 72 - %72 = load i64, ptr %71, align 4 - tail call void @___rxy(i64 %72, double 0x400921FB54442D18, double 0.000000e+00) - %73 = load i64, ptr %5, align 4 - %74 = and i64 %73, 512 - %.not774 = icmp eq i64 %74, 0 - br i1 %.not774, label %panic.i696, label %__barray_mask_return.exit697 - -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %74 = or disjoint i64 %72, 512 + store i64 %74, ptr %9, align 4 + %75 = getelementptr inbounds nuw i8, ptr %8, i64 72 + %76 = load i64, ptr %75, align 4 + tail call void @___rxy(i64 %76, double 0x400921FB54442D18, double 0.000000e+00) + %77 = load i64, ptr %9, align 4 + %78 = and i64 %77, 512 + %.not1705 = icmp eq i64 %78, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %75 = and i64 %73, -513 - store i64 %75, ptr %5, align 4 - store i64 %72, ptr %71, align 4 - %76 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %77 = tail call ptr @heap_alloc(i64 80) - %78 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %78, align 1 - br label %__barray_check_bounds.exit.i.i - -79: ; preds = %loop_body.i - %80 = lshr i64 %.fca.2.extract.i.i, 6 - %81 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %.fca.2.extract.i.i, 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %89 = lshr i64 %last_valid.i.i.i, 6 - %90 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i = sub nsw i64 %89, %80 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -97: ; preds = %mask_block_ok.i.i.i - %98 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %79, %97 - %.02.i.i.i = phi i64 [ %98, %97 ], [ 0, %79 ] - %gep.i.i.i = getelementptr i64, ptr %81, i64 %.02.i.i.i - %99 = load i64, ptr %gep.i.i.i, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %79 = and i64 %77, -513 + store i64 %79, ptr %9, align 4 + store i64 %76, ptr %75, align 4 + br label %__barray_check_bounds.exit1620 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %101, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %76, %__barray_mask_return.exit697 ], [ %116, %loop_body.i ] - %101 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %102 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %102 - %112 = load i64, ptr %111, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %78, align 4 - %114 = lshr i64 %113, %"239_0.sroa.15.0178.i" - %115 = trunc i64 %114 to i1 - br i1 %115, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1616: ; preds = %.thread + %80 = load i64, ptr %3, align 4 + %81 = lshr i64 %80, %"363_2.01721" + %82 = trunc i64 %81 to i1 + br i1 %82, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %116 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %101, 1 - %117 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %118 = xor i64 %113, %117 - store i64 %118, ptr %78, align 4 - %119 = getelementptr inbounds nuw i64, ptr %77, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %119, align 4 - %120 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %120, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %120, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %120, 2 - %exitcond.not.i = icmp eq i64 %101, 10 - br i1 %exitcond.not.i, label %79, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %97, %79 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %77, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %78, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %121 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %122 = tail call ptr @heap_alloc(i64 10) - %123 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %123, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %181, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %125, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %121, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %177, %loop_body.i701 ] - %125 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i714, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i714: ; preds = %__barray_check_bounds.exit.i.i698 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_ok.i: ; preds = %cond_exit_367 + %83 = load i64, ptr %9, align 4 + %84 = or i64 %83, -1024 + store i64 %84, ptr %9, align 4 + %85 = icmp eq i64 %84, -1 + br i1 %85, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01722" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %86, %cond_exit_367 ] + %"363_2.01721" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %94, %cond_exit_367 ] + %86 = add nuw nsw i64 %"363_0.sroa.15.01722", 1 + %87 = load i64, ptr %9, align 4 + %88 = lshr i64 %87, %"363_0.sroa.15.01722" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1621, label %.thread -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_548_case_0.i.i: ; preds = %cond_exit_548.thread.i.i - %140 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %141 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %140 - %142 = load i64, ptr %141, align 4 - %143 = and i64 %"545_1.sroa.10.0.i.i", 63 - %144 = sub nuw nsw i64 64, %143 - %145 = lshr i64 -1, %144 - %146 = icmp eq i64 %143, 0 - %147 = select i1 %146, i64 0, i64 %145 - %148 = or i64 %142, %147 - store i64 %148, ptr %141, align 4 - %last_valid.i.i.i703 = add i64 %"545_1.sroa.10.0.i.i", 9 - %149 = lshr i64 %last_valid.i.i.i703, 6 - %150 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %last_valid.i.i.i703, 63 - %153 = shl nsw i64 -2, %152 - %154 = icmp eq i64 %152, 63 - %155 = select i1 %154, i64 0, i64 %153 - %156 = or i64 %151, %155 - store i64 %156, ptr %150, align 4 - %reass.sub.i.i.i704 = sub nsw i64 %149, %140 - %.not.i.i.i705 = icmp eq i64 %reass.sub.i.i.i704, -1 - br i1 %.not.i.i.i705, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -157: ; preds = %mask_block_ok.i.i.i706 - %158 = add nuw i64 %.02.i.i.i707, 1 - %exitcond.not.i.i.i710 = icmp eq i64 %.02.i.i.i707, %reass.sub.i.i.i704 - br i1 %exitcond.not.i.i.i710, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -mask_block_ok.i.i.i706: ; preds = %cond_548_case_0.i.i, %157 - %.02.i.i.i707 = phi i64 [ %158, %157 ], [ 0, %cond_548_case_0.i.i ] - %gep.i.i.i708 = getelementptr i64, ptr %141, i64 %.02.i.i.i707 - %159 = load i64, ptr %gep.i.i.i708, align 4 - %160 = icmp eq i64 %159, -1 - br i1 %160, label %157, label %mask_block_err.i.i.i709 - -mask_block_err.i.i.i709: ; preds = %mask_block_ok.i.i.i706 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +.thread: ; preds = %__barray_check_bounds.exit1620 + %90 = shl nuw nsw i64 1, %"363_0.sroa.15.01722" + %91 = xor i64 %87, %90 + store i64 %91, ptr %9, align 4 + %92 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01722" + %93 = load i64, ptr %92, align 4 + %94 = add i64 %"363_2.01721", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %93) + tail call void @___qfree(i64 %93) + %95 = icmp ult i64 %"363_2.01721", 10 + br i1 %95, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %96 = shl nuw nsw i64 1, %"363_2.01721" + %97 = xor i64 %80, %96 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01721" + store i64 %lazy_measure, ptr %98, align 4 + %99 = icmp samesign ugt i64 %"363_0.sroa.15.01722", 8 + br i1 %99, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %100, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %100 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %101 = load i64, ptr %3, align 4 + %102 = lshr i64 %101, %"429_0.sroa.15.01708" + %103 = trunc i64 %102 to i1 + br i1 %103, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_548.thread.i.i, %loop_body.preheader.i.i - %"545_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %161, %cond_exit_548.thread.i.i ] - %161 = add nuw nsw i64 %"545_0.0239.i.i", 1 - %162 = add i64 %"545_0.0239.i.i", %"545_1.sroa.10.0.i.i" - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %169, %165 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %161, 10 - br i1 %exitcond.i.i, label %cond_548_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %173 = xor i64 %137, %133 - store i64 %173, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - %174 = load i64, ptr %123, align 4 - %175 = lshr i64 %174, %"280_0.sroa.15.0168.i" - %176 = trunc i64 %175 to i1 - br i1 %176, label %loop_body.i701, label %panic.i.i700 +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %104 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %105 = xor i64 %101, %104 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %107 = load i64, ptr %106, align 4 + tail call void @___inc_future_refcount(i64 %107) + %108 = load i64, ptr %3, align 4 + %109 = lshr i64 %108, %"429_0.sroa.15.01708" + %110 = trunc i64 %109 to i1 + br i1 %110, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %111 = xor i64 %108, %104 + store i64 %111, ptr %3, align 4 + store i64 %107, ptr %106, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %107) + tail call void @___dec_future_refcount(i64 %107) + %112 = load i64, ptr %1, align 4 + %113 = lshr i64 %112, %"429_0.sroa.15.01708" + %114 = trunc i64 %113 to i1 + br i1 %114, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %177 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %178 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %179 = xor i64 %174, %178 - store i64 %179, ptr %123, align 4 - %180 = getelementptr inbounds nuw i1, ptr %122, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %180, align 1 - %181 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %157, %cond_548_case_0.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %182 = load i64, ptr %123, align 4 - %183 = and i64 %182, 1023 - store i64 %183, ptr %123, align 4 - %184 = icmp eq i64 %183, 0 - br i1 %184, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %185 = tail call ptr @heap_alloc(i64 10) - %186 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %186, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %185, ptr noundef nonnull align 1 dereferenceable(10) %122, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %185) - %187 = load i64, ptr %123, align 4 - %188 = and i64 %187, 1023 - store i64 %188, ptr %123, align 4 - %189 = icmp eq i64 %188, 0 - br i1 %189, label %__barray_check_none_borrowed.exit720, label %mask_block_err.i718 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %115 = or disjoint i64 %168, 1 + store i64 %115, ptr %3, align 4 + %116 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 2 + %.not1733 = icmp eq i64 %118, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %119 = or disjoint i64 %117, 2 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 4 + %.not1734 = icmp eq i64 %123, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %124 = or disjoint i64 %122, 4 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 8 + %.not1735 = icmp eq i64 %128, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %129 = or disjoint i64 %127, 8 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 16 + %.not1736 = icmp eq i64 %133, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %134 = or disjoint i64 %132, 16 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 32 + %.not1737 = icmp eq i64 %138, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %139 = or disjoint i64 %137, 32 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 64 + %.not1738 = icmp eq i64 %143, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %144 = or disjoint i64 %142, 64 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 128 + %.not1739 = icmp eq i64 %148, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %149 = or disjoint i64 %147, 128 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 256 + %.not1740 = icmp eq i64 %153, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %154 = or disjoint i64 %152, 256 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %157 = load i64, ptr %3, align 4 + %158 = and i64 %157, 512 + %.not1741 = icmp eq i64 %158, 0 + br i1 %.not1741, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %159 = or disjoint i64 %157, 512 + store i64 %159, ptr %3, align 4 + %160 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %162 = load i64, ptr %3, align 4 + %163 = or i64 %162, -1024 + store i64 %163, ptr %3, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %165 = xor i64 %112, %104 + store i64 %165, ptr %1, align 4 + %166 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %166, align 1 + %167 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %167, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %168 = load i64, ptr %3, align 4 + %169 = trunc i64 %168 to i1 + br i1 %169, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %173 = tail call ptr @heap_alloc(i64 10) + %174 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %174, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %173) + %175 = load i64, ptr %1, align 4 + %176 = and i64 %175, 1023 + store i64 %176, ptr %1, align 4 + %177 = icmp eq i64 %176, 0 + br i1 %177, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit720: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %190 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %190, i8 0, i64 10, i1 false) + %178 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %178, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %122, ptr %arr_ptr, align 8 - store ptr %190, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %178, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit728 + br label %__barray_check_bounds.exit1657 -mask_block_err.i718: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit728: ; preds = %cond_exit_94.1, %__barray_check_none_borrowed.exit720 - %"89_0.sroa.0.0778" = phi i64 [ 0, %__barray_check_none_borrowed.exit720 ], [ %207, %cond_exit_94.1 ] - %191 = lshr i64 %"89_0.sroa.0.0778", 6 - %192 = getelementptr inbounds nuw i64, ptr %3, i64 %191 - %193 = load i64, ptr %192, align 4 - %194 = and i64 %"89_0.sroa.0.0778", 62 - %195 = lshr i64 %193, %194 - %196 = trunc i64 %195 to i1 - br i1 %196, label %cond_exit_94, label %panic.i729 - -panic.i729: ; preds = %cond_exit_94, %__barray_check_bounds.exit728 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147.1, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %195, %cond_exit_147.1 ] + %179 = lshr i64 %"143_2.01709", 6 + %180 = getelementptr inbounds nuw i64, ptr %7, i64 %179 + %181 = load i64, ptr %180, align 4 + %182 = and i64 %"143_2.01709", 62 + %183 = lshr i64 %181, %182 + %184 = trunc i64 %183 to i1 + br i1 %184, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %cond_exit_147, %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit728 - %197 = or disjoint i64 %"89_0.sroa.0.0778", 1 - %198 = shl nuw nsw i64 1, %194 - %199 = xor i64 %193, %198 - store i64 %199, ptr %192, align 4 - %200 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0778" - store i64 %"89_0.sroa.0.0778", ptr %200, align 4 - %201 = lshr i64 %"89_0.sroa.0.0778", 6 - %202 = getelementptr inbounds nuw i64, ptr %3, i64 %201 - %203 = load i64, ptr %202, align 4 - %204 = and i64 %197, 63 - %205 = lshr i64 %203, %204 - %206 = trunc i64 %205 to i1 - br i1 %206, label %cond_exit_94.1, label %panic.i729 - -cond_exit_94.1: ; preds = %cond_exit_94 - %207 = add nuw nsw i64 %"89_0.sroa.0.0778", 2 - %208 = shl nuw i64 1, %204 - %209 = xor i64 %203, %208 - store i64 %209, ptr %202, align 4 - %210 = getelementptr inbounds nuw i64, ptr %2, i64 %197 - store i64 %197, ptr %210, align 4 - %exitcond781.not.1 = icmp eq i64 %207, 100 - br i1 %exitcond781.not.1, label %loop_out127, label %__barray_check_bounds.exit728 - -loop_out127: ; preds = %cond_exit_94.1 - %211 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %212 = load i64, ptr %211, align 4 - %213 = and i64 %212, 68719476735 - store i64 %213, ptr %211, align 4 - %214 = load i64, ptr %3, align 4 - %215 = icmp eq i64 %214, 0 - %216 = icmp eq i64 %213, 0 - %or.cond = select i1 %215, i1 %216, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit735, label %mask_block_err.i733 - -__barray_check_none_borrowed.exit735: ; preds = %loop_out127 - %217 = call ptr @heap_alloc(i64 800) - %218 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %218, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %217, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %217) - %219 = load i64, ptr %211, align 4 - %220 = and i64 %219, 68719476735 - store i64 %220, ptr %211, align 4 - %221 = load i64, ptr %3, align 4 - %222 = icmp eq i64 %221, 0 - %223 = icmp eq i64 %220, 0 - %or.cond783 = select i1 %222, i1 %223, i1 false - br i1 %or.cond783, label %__barray_check_none_borrowed.exit740, label %mask_block_err.i738 - -mask_block_err.i733: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %185 = or disjoint i64 %"143_2.01709", 1 + %186 = shl nuw nsw i64 1, %182 + %187 = xor i64 %181, %186 + store i64 %187, ptr %180, align 4 + %188 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %188, align 4 + %189 = lshr i64 %"143_2.01709", 6 + %190 = getelementptr inbounds nuw i64, ptr %7, i64 %189 + %191 = load i64, ptr %190, align 4 + %192 = and i64 %185, 63 + %193 = lshr i64 %191, %192 + %194 = trunc i64 %193 to i1 + br i1 %194, label %cond_exit_147.1, label %panic.i1658 + +cond_exit_147.1: ; preds = %cond_exit_147 + %195 = add nuw nsw i64 %"143_2.01709", 2 + %196 = shl nuw i64 1, %192 + %197 = xor i64 %191, %196 + store i64 %197, ptr %190, align 4 + %198 = getelementptr inbounds nuw i64, ptr %6, i64 %185 + store i64 %185, ptr %198, align 4 + %exitcond1713.1 = icmp eq i64 %195, 100 + br i1 %exitcond1713.1, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147.1 + %199 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %200 = load i64, ptr %199, align 4 + %201 = and i64 %200, 68719476735 + store i64 %201, ptr %199, align 4 + %202 = load i64, ptr %7, align 4 + %203 = icmp eq i64 %202, 0 + %204 = icmp eq i64 %201, 0 + %or.cond = select i1 %203, i1 %204, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %205 = call ptr @heap_alloc(i64 800) + %206 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %206, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %205, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %205) + %207 = load i64, ptr %199, align 4 + %208 = and i64 %207, 68719476735 + store i64 %208, ptr %199, align 4 + %209 = load i64, ptr %7, align 4 + %210 = icmp eq i64 %209, 0 + %211 = icmp eq i64 %208, 0 + %or.cond1718 = select i1 %210, i1 %211, i1 false + br i1 %or.cond1718, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit740: ; preds = %__barray_check_none_borrowed.exit735 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %224 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %224, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %224, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit748 - -mask_block_err.i738: ; preds = %__barray_check_none_borrowed.exit735 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %212 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %212, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %212, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit748: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit740 - %"124_0.sroa.0.0780" = phi i64 [ 0, %__barray_check_none_borrowed.exit740 ], [ %233, %cond_exit_129 ] - %225 = lshr i64 %"124_0.sroa.0.0780", 6 - %226 = getelementptr inbounds nuw i64, ptr %1, i64 %225 - %227 = load i64, ptr %226, align 4 - %228 = and i64 %"124_0.sroa.0.0780", 63 - %229 = lshr i64 %227, %228 - %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_129, label %panic.i749 - -panic.i749: ; preds = %__barray_check_bounds.exit748 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %221, %cond_exit_253 ] + %213 = lshr i64 %"249_2.01711", 6 + %214 = getelementptr inbounds nuw i64, ptr %5, i64 %213 + %215 = load i64, ptr %214, align 4 + %216 = and i64 %"249_2.01711", 63 + %217 = lshr i64 %215, %216 + %218 = trunc i64 %217 to i1 + br i1 %218, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit748 - %231 = uitofp nneg i64 %"124_0.sroa.0.0780" to double - %232 = fmul double %231, 6.250000e-02 - %233 = add nuw nsw i64 %"124_0.sroa.0.0780", 1 - %234 = shl nuw i64 1, %228 - %235 = xor i64 %227, %234 - store i64 %235, ptr %226, align 4 - %236 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0780" - store double %232, ptr %236, align 8 - %exitcond782.not = icmp eq i64 %233, 100 - br i1 %exitcond782.not, label %loop_out211, label %__barray_check_bounds.exit748 - -loop_out211: ; preds = %cond_exit_129 - %237 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %238 = load i64, ptr %237, align 4 - %239 = and i64 %238, 68719476735 - store i64 %239, ptr %237, align 4 - %240 = load i64, ptr %1, align 4 - %241 = icmp eq i64 %240, 0 - %242 = icmp eq i64 %239, 0 - %or.cond784 = select i1 %241, i1 %242, i1 false - br i1 %or.cond784, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i753 - -__barray_check_none_borrowed.exit755: ; preds = %loop_out211 - %243 = call ptr @heap_alloc(i64 800) - %244 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %244, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %243, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %243) - %245 = load i64, ptr %237, align 4 - %246 = and i64 %245, 68719476735 - store i64 %246, ptr %237, align 4 - %247 = load i64, ptr %1, align 4 - %248 = icmp eq i64 %247, 0 - %249 = icmp eq i64 %246, 0 - %or.cond785 = select i1 %248, i1 %249, i1 false - br i1 %or.cond785, label %__barray_check_none_borrowed.exit760, label %mask_block_err.i758 - -mask_block_err.i753: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %219 = uitofp nneg i64 %"249_2.01711" to double + %220 = fmul double %219, 6.250000e-02 + %221 = add nuw nsw i64 %"249_2.01711", 1 + %222 = shl nuw i64 1, %216 + %223 = xor i64 %215, %222 + store i64 %223, ptr %214, align 4 + %224 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %220, ptr %224, align 8 + %exitcond1714 = icmp eq i64 %221, 100 + br i1 %exitcond1714, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %225 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %226 = load i64, ptr %225, align 4 + %227 = and i64 %226, 68719476735 + store i64 %227, ptr %225, align 4 + %228 = load i64, ptr %5, align 4 + %229 = icmp eq i64 %228, 0 + %230 = icmp eq i64 %227, 0 + %or.cond1719 = select i1 %229, i1 %230, i1 false + br i1 %or.cond1719, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %231 = call ptr @heap_alloc(i64 800) + %232 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %232, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %231, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %231) + %233 = load i64, ptr %225, align 4 + %234 = and i64 %233, 68719476735 + store i64 %234, ptr %225, align 4 + %235 = load i64, ptr %5, align 4 + %236 = icmp eq i64 %235, 0 + %237 = icmp eq i64 %234, 0 + %or.cond1720 = select i1 %236, i1 %237, i1 false + br i1 %or.cond1720, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit760: ; preds = %__barray_check_none_borrowed.exit755 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %250 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %250, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %250, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %238 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %238, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %238, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i758: ; preds = %__barray_check_none_borrowed.exit755 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -759,26 +784,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-apple-darwin.ll index 5e921663..c5ba3570 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-apple-darwin.ll @@ -3,886 +3,757 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.498.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.498.exit.8, %__hugr__.__tk2_sol_qalloc.498.exit.7, %__hugr__.__tk2_sol_qalloc.498.exit.6, %__hugr__.__tk2_sol_qalloc.498.exit.5, %__hugr__.__tk2_sol_qalloc.498.exit.4, %__hugr__.__tk2_sol_qalloc.498.exit.3, %__hugr__.__tk2_sol_qalloc.498.exit.2, %__hugr__.__tk2_sol_qalloc.498.exit.1, %__hugr__.__tk2_sol_qalloc.498.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.553.exit.8, %__hugr__.__tk2_sol_qalloc.553.exit.7, %__hugr__.__tk2_sol_qalloc.553.exit.6, %__hugr__.__tk2_sol_qalloc.553.exit.5, %__hugr__.__tk2_sol_qalloc.553.exit.4, %__hugr__.__tk2_sol_qalloc.553.exit.3, %__hugr__.__tk2_sol_qalloc.553.exit.2, %__hugr__.__tk2_sol_qalloc.553.exit.1, %__hugr__.__tk2_sol_qalloc.553.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.1 -__hugr__.__tk2_sol_qalloc.498.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.553.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not781 = icmp eq i64 %10, 0 - br i1 %.not781, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1714 = icmp eq i64 %14, 0 + br i1 %.not1714, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.2 -__hugr__.__tk2_sol_qalloc.498.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.553.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not782 = icmp eq i64 %14, 0 - br i1 %.not782, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1715 = icmp eq i64 %18, 0 + br i1 %.not1715, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.3 -__hugr__.__tk2_sol_qalloc.498.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.553.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not783 = icmp eq i64 %18, 0 - br i1 %.not783, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1716 = icmp eq i64 %22, 0 + br i1 %.not1716, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.4 -__hugr__.__tk2_sol_qalloc.498.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.553.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not784 = icmp eq i64 %22, 0 - br i1 %.not784, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1717 = icmp eq i64 %26, 0 + br i1 %.not1717, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.5 -__hugr__.__tk2_sol_qalloc.498.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.553.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not785 = icmp eq i64 %26, 0 - br i1 %.not785, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1718 = icmp eq i64 %30, 0 + br i1 %.not1718, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.6 -__hugr__.__tk2_sol_qalloc.498.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.553.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not786 = icmp eq i64 %30, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1719 = icmp eq i64 %34, 0 + br i1 %.not1719, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.7 -__hugr__.__tk2_sol_qalloc.498.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.553.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not787 = icmp eq i64 %34, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1720 = icmp eq i64 %38, 0 + br i1 %.not1720, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.8 -__hugr__.__tk2_sol_qalloc.498.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.553.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not788 = icmp eq i64 %38, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1721 = icmp eq i64 %42, 0 + br i1 %.not1721, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not789 = icmp eq i64 %42, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1722 = icmp eq i64 %46, 0 + br i1 %.not1722, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %55, double 0x400921FB54442D18, double 0.000000e+00) - %56 = load i64, ptr %5, align 4 - %57 = and i64 %56, 4 - %.not769 = icmp eq i64 %57, 0 - br i1 %.not769, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %59, double 0x400921FB54442D18, double 0.000000e+00) + %60 = load i64, ptr %9, align 4 + %61 = and i64 %60, 4 + %.not1701 = icmp eq i64 %61, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %58 = and i64 %56, -5 - store i64 %58, ptr %5, align 4 - store i64 %55, ptr %16, align 4 - %59 = load i64, ptr %5, align 4 - %60 = and i64 %59, 8 - %.not770 = icmp eq i64 %60, 0 - br i1 %.not770, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %62 = and i64 %60, -5 + store i64 %62, ptr %9, align 4 + store i64 %59, ptr %20, align 4 + %63 = load i64, ptr %9, align 4 + %64 = and i64 %63, 8 + %.not1702 = icmp eq i64 %64, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %61 = or disjoint i64 %59, 8 - store i64 %61, ptr %5, align 4 - %62 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %62, double 0x400921FB54442D18, double 0.000000e+00) - %63 = load i64, ptr %5, align 4 - %64 = and i64 %63, 8 - %.not771 = icmp eq i64 %64, 0 - br i1 %.not771, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %65 = or disjoint i64 %63, 8 + store i64 %65, ptr %9, align 4 + %66 = load i64, ptr %24, align 4 + tail call void @___rp(i64 %66, double 0x400921FB54442D18, double 0.000000e+00) + %67 = load i64, ptr %9, align 4 + %68 = and i64 %67, 8 + %.not1703 = icmp eq i64 %68, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %65 = and i64 %63, -9 - store i64 %65, ptr %5, align 4 - store i64 %62, ptr %20, align 4 - %66 = load i64, ptr %5, align 4 - %67 = and i64 %66, 512 - %.not772 = icmp eq i64 %67, 0 - br i1 %.not772, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %69 = and i64 %67, -9 + store i64 %69, ptr %9, align 4 + store i64 %66, ptr %24, align 4 + %70 = load i64, ptr %9, align 4 + %71 = and i64 %70, 512 + %.not1704 = icmp eq i64 %71, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %68 = or disjoint i64 %66, 512 - store i64 %68, ptr %5, align 4 - %69 = load i64, ptr %44, align 4 - tail call void @___rp(i64 %69, double 0x400921FB54442D18, double 0.000000e+00) - %70 = load i64, ptr %5, align 4 - %71 = and i64 %70, 512 - %.not773 = icmp eq i64 %71, 0 - br i1 %.not773, label %panic.i696, label %__barray_mask_return.exit697 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %72 = or disjoint i64 %70, 512 + store i64 %72, ptr %9, align 4 + %73 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %73, double 0x400921FB54442D18, double 0.000000e+00) + %74 = load i64, ptr %9, align 4 + %75 = and i64 %74, 512 + %.not1705 = icmp eq i64 %75, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %76 = and i64 %74, -513 + store i64 %76, ptr %9, align 4 + store i64 %73, ptr %48, align 4 + br label %__barray_check_bounds.exit1620 + +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_check_bounds.exit1616: ; preds = %.thread + %77 = load i64, ptr %3, align 4 + %78 = lshr i64 %77, %"363_2.01729" + %79 = trunc i64 %78 to i1 + br i1 %79, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %72 = and i64 %70, -513 - store i64 %72, ptr %5, align 4 - store i64 %69, ptr %44, align 4 - %73 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %74 = tail call ptr @heap_alloc(i64 80) - %75 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %75, align 1 - br label %__barray_check_bounds.exit.i.i - -76: ; preds = %loop_body.i - %77 = lshr i64 %.fca.2.extract.i.i, 6 - %78 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %77 - %79 = load i64, ptr %78, align 4 - %80 = and i64 %.fca.2.extract.i.i, 63 - %81 = sub nuw nsw i64 64, %80 - %82 = lshr i64 -1, %81 - %83 = icmp eq i64 %80, 0 - %84 = select i1 %83, i64 0, i64 %82 - %85 = or i64 %79, %84 - store i64 %85, ptr %78, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %86 = lshr i64 %last_valid.i.i.i, 6 - %87 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %86 - %88 = load i64, ptr %87, align 4 - %89 = and i64 %last_valid.i.i.i, 63 - %90 = shl nsw i64 -2, %89 - %91 = icmp eq i64 %89, 63 - %92 = select i1 %91, i64 0, i64 %90 - %93 = or i64 %88, %92 - store i64 %93, ptr %87, align 4 - %reass.sub.i.i.i = sub nsw i64 %86, %77 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -94: ; preds = %mask_block_ok.i.i.i - %95 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %76, %94 - %.02.i.i.i = phi i64 [ %95, %94 ], [ 0, %76 ] - %gep.i.i.i = getelementptr i64, ptr %78, i64 %.02.i.i.i - %96 = load i64, ptr %gep.i.i.i, align 4 - %97 = icmp eq i64 %96, -1 - br i1 %97, label %94, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i +mask_block_ok.i: ; preds = %cond_exit_367 + %80 = load i64, ptr %9, align 4 + %81 = or i64 %80, -1024 + store i64 %81, ptr %9, align 4 + %82 = icmp eq i64 %81, -1 + br i1 %82, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %98, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %73, %__barray_mask_return.exit697 ], [ %113, %loop_body.i ] - %98 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %99 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %100 = lshr i64 %99, 6 - %101 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %100 - %102 = load i64, ptr %101, align 4 - %103 = and i64 %99, 63 - %104 = lshr i64 %102, %103 - %105 = trunc i64 %104 to i1 - br i1 %105, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01730" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %83, %cond_exit_367 ] + %"363_2.01729" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %91, %cond_exit_367 ] + %83 = add nuw nsw i64 %"363_0.sroa.15.01730", 1 + %84 = load i64, ptr %9, align 4 + %85 = lshr i64 %84, %"363_0.sroa.15.01730" + %86 = trunc i64 %85 to i1 + br i1 %86, label %panic.i1621, label %.thread -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %106 = shl nuw i64 1, %103 - %107 = xor i64 %106, %102 - store i64 %107, ptr %101, align 4 - %108 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %99 - %109 = load i64, ptr %108, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %109) - tail call void @___qfree(i64 %109) - %110 = load i64, ptr %75, align 4 - %111 = lshr i64 %110, %"239_0.sroa.15.0178.i" - %112 = trunc i64 %111 to i1 - br i1 %112, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %113 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %98, 1 - %114 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %115 = xor i64 %110, %114 - store i64 %115, ptr %75, align 4 - %116 = getelementptr inbounds nuw i64, ptr %74, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %116, align 4 - %117 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %117, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %117, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %117, 2 - %exitcond.not.i = icmp eq i64 %98, 10 - br i1 %exitcond.not.i, label %76, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %94, %76 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %74, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %75, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %118 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %119 = tail call ptr @heap_alloc(i64 10) - %120 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %120, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 0 - %121 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %122 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %"545_1.sroa.10.0.i.i", 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %127 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %269, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %128, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %118, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %265, %loop_body.i701 ] - %128 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %127, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %127, 1 - %129 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %130 = lshr i64 %129, 6 - %131 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %130 - %132 = load i64, ptr %131, align 4 - %133 = and i64 %129, 63 - %134 = lshr i64 %132, %133 - %135 = trunc i64 %134 to i1 - br i1 %135, label %panic.i.i.i713, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i713: ; preds = %__barray_check_bounds.exit.i.i698 +.thread: ; preds = %__barray_check_bounds.exit1620 + %87 = shl nuw nsw i64 1, %"363_0.sroa.15.01730" + %88 = xor i64 %84, %87 + store i64 %88, ptr %9, align 4 + %89 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01730" + %90 = load i64, ptr %89, align 4 + %91 = add i64 %"363_2.01729", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %90) + tail call void @___qfree(i64 %90) + %92 = icmp ult i64 %"363_2.01729", 10 + br i1 %92, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %93 = shl nuw nsw i64 1, %"363_2.01729" + %94 = xor i64 %77, %93 + store i64 %94, ptr %3, align 4 + %95 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01729" + store i64 %lazy_measure, ptr %95, align 4 + %96 = icmp samesign ugt i64 %"363_0.sroa.15.01730", 8 + br i1 %96, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %97, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %97 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %98 = load i64, ptr %3, align 4 + %99 = lshr i64 %98, %"429_0.sroa.15.01708" + %100 = trunc i64 %99 to i1 + br i1 %100, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %127, 0 - %136 = shl nuw i64 1, %133 - %137 = xor i64 %136, %132 - store i64 %137, ptr %131, align 4 - %138 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %129 - %139 = load i64, ptr %138, align 4 - tail call void @___inc_future_refcount(i64 %139) - %140 = load i64, ptr %131, align 4 - %141 = lshr i64 %140, %133 - %142 = trunc i64 %141 to i1 - br i1 %142, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %101 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %102 = xor i64 %98, %101 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %104 = load i64, ptr %103, align 4 + tail call void @___inc_future_refcount(i64 %104) + %105 = load i64, ptr %3, align 4 + %106 = lshr i64 %105, %"429_0.sroa.15.01708" + %107 = trunc i64 %106 to i1 + br i1 %107, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -143: ; preds = %mask_block_ok.i.i.i705 - %144 = add nuw i64 %.02.i.i.i706, 1 - %exitcond.not.i.i.i709 = icmp eq i64 %.02.i.i.i706, %reass.sub.i.i.i703 - br i1 %exitcond.not.i.i.i709, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -mask_block_ok.i.i.i705: ; preds = %cond_exit_548.thread.9.i.i, %143 - %.02.i.i.i706 = phi i64 [ %144, %143 ], [ 0, %cond_exit_548.thread.9.i.i ] - %gep.i.i.i707 = getelementptr i64, ptr %122, i64 %.02.i.i.i706 - %145 = load i64, ptr %gep.i.i.i707, align 4 - %146 = icmp eq i64 %145, -1 - br i1 %146, label %143, label %mask_block_err.i.i.i708 - -mask_block_err.i.i.i708: ; preds = %mask_block_ok.i.i.i705 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %108 = xor i64 %105, %101 + store i64 %108, ptr %3, align 4 + store i64 %104, ptr %103, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %104) + tail call void @___dec_future_refcount(i64 %104) + %109 = load i64, ptr %1, align 4 + %110 = lshr i64 %109, %"429_0.sroa.15.01708" + %111 = trunc i64 %110 to i1 + br i1 %111, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %147 = shl nuw i64 1, %124 - %148 = xor i64 %123, %147 - store i64 %148, ptr %122, align 4 - %149 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %"545_1.sroa.10.0.i.i" - %150 = load i64, ptr %149, align 4 - tail call void @___dec_future_refcount(i64 %150) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %151 = add i64 %"545_1.sroa.10.0.i.i", 1 - %152 = lshr i64 %151, 6 - %153 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %152 - %154 = load i64, ptr %153, align 4 - %155 = and i64 %151, 63 - %156 = lshr i64 %154, %155 - %157 = trunc i64 %156 to i1 - br i1 %157, label %cond_exit_548.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_548.thread.i.i - %158 = shl nuw i64 1, %155 - %159 = xor i64 %154, %158 - store i64 %159, ptr %153, align 4 - %160 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %151 - %161 = load i64, ptr %160, align 4 - tail call void @___dec_future_refcount(i64 %161) - br label %cond_exit_548.thread.1.i.i - -cond_exit_548.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_548.thread.i.i - %162 = add i64 %"545_1.sroa.10.0.i.i", 2 - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_548.thread.1.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %165, %169 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.2.i.i - -cond_exit_548.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_548.thread.1.i.i - %173 = add i64 %"545_1.sroa.10.0.i.i", 3 - %174 = lshr i64 %173, 6 - %175 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %174 - %176 = load i64, ptr %175, align 4 - %177 = and i64 %173, 63 - %178 = lshr i64 %176, %177 - %179 = trunc i64 %178 to i1 - br i1 %179, label %cond_exit_548.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_548.thread.2.i.i - %180 = shl nuw i64 1, %177 - %181 = xor i64 %176, %180 - store i64 %181, ptr %175, align 4 - %182 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %173 - %183 = load i64, ptr %182, align 4 - tail call void @___dec_future_refcount(i64 %183) - br label %cond_exit_548.thread.3.i.i - -cond_exit_548.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_548.thread.2.i.i - %184 = add i64 %"545_1.sroa.10.0.i.i", 4 - %185 = lshr i64 %184, 6 - %186 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %185 - %187 = load i64, ptr %186, align 4 - %188 = and i64 %184, 63 - %189 = lshr i64 %187, %188 - %190 = trunc i64 %189 to i1 - br i1 %190, label %cond_exit_548.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_548.thread.3.i.i - %191 = shl nuw i64 1, %188 - %192 = xor i64 %187, %191 - store i64 %192, ptr %186, align 4 - %193 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %184 - %194 = load i64, ptr %193, align 4 - tail call void @___dec_future_refcount(i64 %194) - br label %cond_exit_548.thread.4.i.i - -cond_exit_548.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_548.thread.3.i.i - %195 = add i64 %"545_1.sroa.10.0.i.i", 5 - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_548.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_548.thread.4.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %198, %202 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_548.thread.5.i.i - -cond_exit_548.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_548.thread.4.i.i - %206 = add i64 %"545_1.sroa.10.0.i.i", 6 - %207 = lshr i64 %206, 6 - %208 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %207 - %209 = load i64, ptr %208, align 4 - %210 = and i64 %206, 63 - %211 = lshr i64 %209, %210 - %212 = trunc i64 %211 to i1 - br i1 %212, label %cond_exit_548.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_548.thread.5.i.i - %213 = shl nuw i64 1, %210 - %214 = xor i64 %209, %213 - store i64 %214, ptr %208, align 4 - %215 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %206 - %216 = load i64, ptr %215, align 4 - tail call void @___dec_future_refcount(i64 %216) - br label %cond_exit_548.thread.6.i.i - -cond_exit_548.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_548.thread.5.i.i - %217 = add i64 %"545_1.sroa.10.0.i.i", 7 - %218 = lshr i64 %217, 6 - %219 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %218 - %220 = load i64, ptr %219, align 4 - %221 = and i64 %217, 63 - %222 = lshr i64 %220, %221 - %223 = trunc i64 %222 to i1 - br i1 %223, label %cond_exit_548.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_548.thread.6.i.i - %224 = shl nuw i64 1, %221 - %225 = xor i64 %220, %224 - store i64 %225, ptr %219, align 4 - %226 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %217 - %227 = load i64, ptr %226, align 4 - tail call void @___dec_future_refcount(i64 %227) - br label %cond_exit_548.thread.7.i.i - -cond_exit_548.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_548.thread.6.i.i - %228 = add i64 %"545_1.sroa.10.0.i.i", 8 - %229 = lshr i64 %228, 6 - %230 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %229 - %231 = load i64, ptr %230, align 4 - %232 = and i64 %228, 63 - %233 = lshr i64 %231, %232 - %234 = trunc i64 %233 to i1 - br i1 %234, label %cond_exit_548.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_548.thread.7.i.i - %235 = shl nuw i64 1, %232 - %236 = xor i64 %231, %235 - store i64 %236, ptr %230, align 4 - %237 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %228 - %238 = load i64, ptr %237, align 4 - tail call void @___dec_future_refcount(i64 %238) - br label %cond_exit_548.thread.8.i.i - -cond_exit_548.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_548.thread.7.i.i - %239 = add i64 %"545_1.sroa.10.0.i.i", 9 - %240 = lshr i64 %239, 6 - %241 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %240 - %242 = load i64, ptr %241, align 4 - %243 = and i64 %239, 63 - %244 = lshr i64 %242, %243 - %245 = trunc i64 %244 to i1 - br i1 %245, label %cond_exit_548.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_548.thread.8.i.i - %246 = shl nuw i64 1, %243 - %247 = xor i64 %242, %246 - store i64 %247, ptr %241, align 4 - %248 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %239 - %249 = load i64, ptr %248, align 4 - tail call void @___dec_future_refcount(i64 %249) - br label %cond_exit_548.thread.9.i.i - -cond_exit_548.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_548.thread.8.i.i - %250 = load i64, ptr %122, align 4 - %251 = sub nuw nsw i64 64, %124 - %252 = lshr i64 -1, %251 - %253 = icmp eq i64 %124, 0 - %254 = select i1 %253, i64 0, i64 %252 - %255 = or i64 %250, %254 - store i64 %255, ptr %122, align 4 - %256 = load i64, ptr %241, align 4 - %257 = shl nsw i64 -2, %243 - %258 = icmp eq i64 %243, 63 - %259 = select i1 %258, i64 0, i64 %257 - %260 = or i64 %256, %259 - store i64 %260, ptr %241, align 4 - %reass.sub.i.i.i703 = sub nsw i64 %240, %121 - %.not.i.i.i704 = icmp eq i64 %reass.sub.i.i.i703, -1 - br i1 %.not.i.i.i704, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %261 = xor i64 %140, %136 - store i64 %261, ptr %131, align 4 - store i64 %139, ptr %138, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %139) - tail call void @___dec_future_refcount(i64 %139) - %262 = load i64, ptr %120, align 4 - %263 = lshr i64 %262, %"280_0.sroa.15.0168.i" - %264 = trunc i64 %263 to i1 - br i1 %264, label %loop_body.i701, label %panic.i.i700 - -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %265 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %128, 1 - %266 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %267 = xor i64 %262, %266 - store i64 %267, ptr %120, align 4 - %268 = getelementptr inbounds nuw i1, ptr %119, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %268, align 1 - %269 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %128, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %143, %cond_exit_548.thread.9.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %270 = load i64, ptr %120, align 4 - %271 = and i64 %270, 1023 - store i64 %271, ptr %120, align 4 - %272 = icmp eq i64 %271, 0 - br i1 %272, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %273 = tail call ptr @heap_alloc(i64 10) - %274 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %274, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %273, ptr noundef nonnull align 1 dereferenceable(10) %119, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %273) - %275 = load i64, ptr %120, align 4 - %276 = and i64 %275, 1023 - store i64 %276, ptr %120, align 4 - %277 = icmp eq i64 %276, 0 - br i1 %277, label %__barray_check_none_borrowed.exit719, label %mask_block_err.i717 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %112 = or disjoint i64 %165, 1 + store i64 %112, ptr %3, align 4 + %113 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %113) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not1732 = icmp eq i64 %115, 0 + br i1 %.not1732, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %116 = or disjoint i64 %114, 2 + store i64 %116, ptr %3, align 4 + %117 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %118 = load i64, ptr %117, align 4 + tail call void @___dec_future_refcount(i64 %118) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %119 = load i64, ptr %3, align 4 + %120 = and i64 %119, 4 + %.not1733 = icmp eq i64 %120, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %121 = or disjoint i64 %119, 4 + store i64 %121, ptr %3, align 4 + %122 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %123 = load i64, ptr %122, align 4 + tail call void @___dec_future_refcount(i64 %123) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %124 = load i64, ptr %3, align 4 + %125 = and i64 %124, 8 + %.not1734 = icmp eq i64 %125, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %3, align 4 + %127 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %128 = load i64, ptr %127, align 4 + tail call void @___dec_future_refcount(i64 %128) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %129 = load i64, ptr %3, align 4 + %130 = and i64 %129, 16 + %.not1735 = icmp eq i64 %130, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %131 = or disjoint i64 %129, 16 + store i64 %131, ptr %3, align 4 + %132 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %133 = load i64, ptr %132, align 4 + tail call void @___dec_future_refcount(i64 %133) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %134 = load i64, ptr %3, align 4 + %135 = and i64 %134, 32 + %.not1736 = icmp eq i64 %135, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %136 = or disjoint i64 %134, 32 + store i64 %136, ptr %3, align 4 + %137 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %138 = load i64, ptr %137, align 4 + tail call void @___dec_future_refcount(i64 %138) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %139 = load i64, ptr %3, align 4 + %140 = and i64 %139, 64 + %.not1737 = icmp eq i64 %140, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %141 = or disjoint i64 %139, 64 + store i64 %141, ptr %3, align 4 + %142 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %143 = load i64, ptr %142, align 4 + tail call void @___dec_future_refcount(i64 %143) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %144 = load i64, ptr %3, align 4 + %145 = and i64 %144, 128 + %.not1738 = icmp eq i64 %145, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %146 = or disjoint i64 %144, 128 + store i64 %146, ptr %3, align 4 + %147 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %148 = load i64, ptr %147, align 4 + tail call void @___dec_future_refcount(i64 %148) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %149 = load i64, ptr %3, align 4 + %150 = and i64 %149, 256 + %.not1739 = icmp eq i64 %150, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %151 = or disjoint i64 %149, 256 + store i64 %151, ptr %3, align 4 + %152 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %153 = load i64, ptr %152, align 4 + tail call void @___dec_future_refcount(i64 %153) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %154 = load i64, ptr %3, align 4 + %155 = and i64 %154, 512 + %.not1740 = icmp eq i64 %155, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %156 = or disjoint i64 %154, 512 + store i64 %156, ptr %3, align 4 + %157 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %158 = load i64, ptr %157, align 4 + tail call void @___dec_future_refcount(i64 %158) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %159 = load i64, ptr %3, align 4 + %160 = or i64 %159, -1024 + store i64 %160, ptr %3, align 4 + %161 = icmp eq i64 %160, -1 + br i1 %161, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %162 = xor i64 %109, %101 + store i64 %162, ptr %1, align 4 + %163 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %163, align 1 + %164 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %164, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %165 = load i64, ptr %3, align 4 + %166 = trunc i64 %165 to i1 + br i1 %166, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %167 = load i64, ptr %1, align 4 + %168 = and i64 %167, 1023 + store i64 %168, ptr %1, align 4 + %169 = icmp eq i64 %168, 0 + br i1 %169, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %170 = tail call ptr @heap_alloc(i64 10) + %171 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %171, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %170, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %170) + %172 = load i64, ptr %1, align 4 + %173 = and i64 %172, 1023 + store i64 %173, ptr %1, align 4 + %174 = icmp eq i64 %173, 0 + br i1 %174, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit719: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %278 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %278, i8 0, i64 10, i1 false) + %175 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %175, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %119, ptr %arr_ptr, align 8 - store ptr %278, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %175, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit727 + br label %__barray_check_bounds.exit1657 -mask_block_err.i717: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit727: ; preds = %cond_exit_94, %__barray_check_none_borrowed.exit719 - %"89_0.sroa.0.0777" = phi i64 [ 0, %__barray_check_none_borrowed.exit719 ], [ %285, %cond_exit_94 ] - %279 = lshr i64 %"89_0.sroa.0.0777", 6 - %280 = getelementptr inbounds nuw i64, ptr %3, i64 %279 - %281 = load i64, ptr %280, align 4 - %282 = and i64 %"89_0.sroa.0.0777", 63 - %283 = lshr i64 %281, %282 - %284 = trunc i64 %283 to i1 - br i1 %284, label %cond_exit_94, label %panic.i728 - -panic.i728: ; preds = %__barray_check_bounds.exit727 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %182, %cond_exit_147 ] + %176 = lshr i64 %"143_2.01709", 6 + %177 = getelementptr inbounds nuw i64, ptr %7, i64 %176 + %178 = load i64, ptr %177, align 4 + %179 = and i64 %"143_2.01709", 63 + %180 = lshr i64 %178, %179 + %181 = trunc i64 %180 to i1 + br i1 %181, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit727 - %285 = add nuw nsw i64 %"89_0.sroa.0.0777", 1 - %286 = shl nuw i64 1, %282 - %287 = xor i64 %281, %286 - store i64 %287, ptr %280, align 4 - %288 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0777" - store i64 %"89_0.sroa.0.0777", ptr %288, align 4 - %exitcond.not = icmp eq i64 %285, 100 - br i1 %exitcond.not, label %loop_out127, label %__barray_check_bounds.exit727 - -loop_out127: ; preds = %cond_exit_94 - %289 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %290 = load i64, ptr %289, align 4 - %291 = and i64 %290, 68719476735 - store i64 %291, ptr %289, align 4 - %292 = load i64, ptr %3, align 4 - %293 = icmp eq i64 %292, 0 - %294 = icmp eq i64 %291, 0 - %or.cond = select i1 %293, i1 %294, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit734, label %mask_block_err.i732 - -__barray_check_none_borrowed.exit734: ; preds = %loop_out127 - %295 = call ptr @heap_alloc(i64 800) - %296 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %296, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %295, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %295) - %297 = load i64, ptr %289, align 4 - %298 = and i64 %297, 68719476735 - store i64 %298, ptr %289, align 4 - %299 = load i64, ptr %3, align 4 - %300 = icmp eq i64 %299, 0 - %301 = icmp eq i64 %298, 0 - %or.cond790 = select i1 %300, i1 %301, i1 false - br i1 %or.cond790, label %__barray_check_none_borrowed.exit739, label %mask_block_err.i737 - -mask_block_err.i732: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %182 = add nuw nsw i64 %"143_2.01709", 1 + %183 = shl nuw i64 1, %179 + %184 = xor i64 %178, %183 + store i64 %184, ptr %177, align 4 + %185 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %185, align 4 + %exitcond = icmp eq i64 %182, 100 + br i1 %exitcond, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147 + %186 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %187 = load i64, ptr %186, align 4 + %188 = and i64 %187, 68719476735 + store i64 %188, ptr %186, align 4 + %189 = load i64, ptr %7, align 4 + %190 = icmp eq i64 %189, 0 + %191 = icmp eq i64 %188, 0 + %or.cond = select i1 %190, i1 %191, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %192 = call ptr @heap_alloc(i64 800) + %193 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %193, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %192, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %192) + %194 = load i64, ptr %186, align 4 + %195 = and i64 %194, 68719476735 + store i64 %195, ptr %186, align 4 + %196 = load i64, ptr %7, align 4 + %197 = icmp eq i64 %196, 0 + %198 = icmp eq i64 %195, 0 + %or.cond1726 = select i1 %197, i1 %198, i1 false + br i1 %or.cond1726, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit739: ; preds = %__barray_check_none_borrowed.exit734 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %302 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %302, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %302, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit747 - -mask_block_err.i737: ; preds = %__barray_check_none_borrowed.exit734 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %199 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %199, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %199, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit747: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit739 - %"124_0.sroa.0.0779" = phi i64 [ 0, %__barray_check_none_borrowed.exit739 ], [ %311, %cond_exit_129 ] - %303 = lshr i64 %"124_0.sroa.0.0779", 6 - %304 = getelementptr inbounds nuw i64, ptr %1, i64 %303 - %305 = load i64, ptr %304, align 4 - %306 = and i64 %"124_0.sroa.0.0779", 63 - %307 = lshr i64 %305, %306 - %308 = trunc i64 %307 to i1 - br i1 %308, label %cond_exit_129, label %panic.i748 - -panic.i748: ; preds = %__barray_check_bounds.exit747 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %208, %cond_exit_253 ] + %200 = lshr i64 %"249_2.01711", 6 + %201 = getelementptr inbounds nuw i64, ptr %5, i64 %200 + %202 = load i64, ptr %201, align 4 + %203 = and i64 %"249_2.01711", 63 + %204 = lshr i64 %202, %203 + %205 = trunc i64 %204 to i1 + br i1 %205, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit747 - %309 = uitofp nneg i64 %"124_0.sroa.0.0779" to double - %310 = fmul double %309, 6.250000e-02 - %311 = add nuw nsw i64 %"124_0.sroa.0.0779", 1 - %312 = shl nuw i64 1, %306 - %313 = xor i64 %305, %312 - store i64 %313, ptr %304, align 4 - %314 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0779" - store double %310, ptr %314, align 8 - %exitcond780.not = icmp eq i64 %311, 100 - br i1 %exitcond780.not, label %loop_out211, label %__barray_check_bounds.exit747 - -loop_out211: ; preds = %cond_exit_129 - %315 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %316 = load i64, ptr %315, align 4 - %317 = and i64 %316, 68719476735 - store i64 %317, ptr %315, align 4 - %318 = load i64, ptr %1, align 4 - %319 = icmp eq i64 %318, 0 - %320 = icmp eq i64 %317, 0 - %or.cond791 = select i1 %319, i1 %320, i1 false - br i1 %or.cond791, label %__barray_check_none_borrowed.exit754, label %mask_block_err.i752 - -__barray_check_none_borrowed.exit754: ; preds = %loop_out211 - %321 = call ptr @heap_alloc(i64 800) - %322 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %322, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %321, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %321) - %323 = load i64, ptr %315, align 4 - %324 = and i64 %323, 68719476735 - store i64 %324, ptr %315, align 4 - %325 = load i64, ptr %1, align 4 - %326 = icmp eq i64 %325, 0 - %327 = icmp eq i64 %324, 0 - %or.cond792 = select i1 %326, i1 %327, i1 false - br i1 %or.cond792, label %__barray_check_none_borrowed.exit759, label %mask_block_err.i757 - -mask_block_err.i752: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %206 = uitofp nneg i64 %"249_2.01711" to double + %207 = fmul double %206, 6.250000e-02 + %208 = add nuw nsw i64 %"249_2.01711", 1 + %209 = shl nuw i64 1, %203 + %210 = xor i64 %202, %209 + store i64 %210, ptr %201, align 4 + %211 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %207, ptr %211, align 8 + %exitcond1713 = icmp eq i64 %208, 100 + br i1 %exitcond1713, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %212 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %213 = load i64, ptr %212, align 4 + %214 = and i64 %213, 68719476735 + store i64 %214, ptr %212, align 4 + %215 = load i64, ptr %5, align 4 + %216 = icmp eq i64 %215, 0 + %217 = icmp eq i64 %214, 0 + %or.cond1727 = select i1 %216, i1 %217, i1 false + br i1 %or.cond1727, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %218 = call ptr @heap_alloc(i64 800) + %219 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %219, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %218, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %218) + %220 = load i64, ptr %212, align 4 + %221 = and i64 %220, 68719476735 + store i64 %221, ptr %212, align 4 + %222 = load i64, ptr %5, align 4 + %223 = icmp eq i64 %222, 0 + %224 = icmp eq i64 %221, 0 + %or.cond1728 = select i1 %223, i1 %224, i1 false + br i1 %or.cond1728, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit759: ; preds = %__barray_check_none_borrowed.exit754 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %328 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %328, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %328, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %225 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %225, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %225, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i757: ; preds = %__barray_check_none_borrowed.exit754 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -895,26 +766,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-unknown-linux-gnu.ll index 3cd9657e..d6d7bc0d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-aarch64-unknown-linux-gnu.ll @@ -3,886 +3,757 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.498.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.553.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.498.exit.8, %__hugr__.__tk2_sol_qalloc.498.exit.7, %__hugr__.__tk2_sol_qalloc.498.exit.6, %__hugr__.__tk2_sol_qalloc.498.exit.5, %__hugr__.__tk2_sol_qalloc.498.exit.4, %__hugr__.__tk2_sol_qalloc.498.exit.3, %__hugr__.__tk2_sol_qalloc.498.exit.2, %__hugr__.__tk2_sol_qalloc.498.exit.1, %__hugr__.__tk2_sol_qalloc.498.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.553.exit.8, %__hugr__.__tk2_sol_qalloc.553.exit.7, %__hugr__.__tk2_sol_qalloc.553.exit.6, %__hugr__.__tk2_sol_qalloc.553.exit.5, %__hugr__.__tk2_sol_qalloc.553.exit.4, %__hugr__.__tk2_sol_qalloc.553.exit.3, %__hugr__.__tk2_sol_qalloc.553.exit.2, %__hugr__.__tk2_sol_qalloc.553.exit.1, %__hugr__.__tk2_sol_qalloc.553.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.1 -__hugr__.__tk2_sol_qalloc.498.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.553.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not781 = icmp eq i64 %10, 0 - br i1 %.not781, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1714 = icmp eq i64 %14, 0 + br i1 %.not1714, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.2 -__hugr__.__tk2_sol_qalloc.498.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.553.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not782 = icmp eq i64 %14, 0 - br i1 %.not782, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1715 = icmp eq i64 %18, 0 + br i1 %.not1715, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.3 -__hugr__.__tk2_sol_qalloc.498.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.553.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not783 = icmp eq i64 %18, 0 - br i1 %.not783, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1716 = icmp eq i64 %22, 0 + br i1 %.not1716, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.4 -__hugr__.__tk2_sol_qalloc.498.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.553.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not784 = icmp eq i64 %22, 0 - br i1 %.not784, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1717 = icmp eq i64 %26, 0 + br i1 %.not1717, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.5 -__hugr__.__tk2_sol_qalloc.498.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.553.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not785 = icmp eq i64 %26, 0 - br i1 %.not785, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1718 = icmp eq i64 %30, 0 + br i1 %.not1718, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.6 -__hugr__.__tk2_sol_qalloc.498.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.553.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not786 = icmp eq i64 %30, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1719 = icmp eq i64 %34, 0 + br i1 %.not1719, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.7 -__hugr__.__tk2_sol_qalloc.498.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.553.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not787 = icmp eq i64 %34, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1720 = icmp eq i64 %38, 0 + br i1 %.not1720, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__hugr__.__tk2_sol_qalloc.498.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__hugr__.__tk2_sol_qalloc.553.exit.8 -__hugr__.__tk2_sol_qalloc.498.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.553.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not788 = icmp eq i64 %38, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.498.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1721 = icmp eq i64 %42, 0 + br i1 %.not1721, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_sol_qalloc.553.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not789 = icmp eq i64 %42, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1722 = icmp eq i64 %46, 0 + br i1 %.not1722, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = load i64, ptr %16, align 4 - tail call void @___rp(i64 %55, double 0x400921FB54442D18, double 0.000000e+00) - %56 = load i64, ptr %5, align 4 - %57 = and i64 %56, 4 - %.not769 = icmp eq i64 %57, 0 - br i1 %.not769, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = load i64, ptr %20, align 4 + tail call void @___rp(i64 %59, double 0x400921FB54442D18, double 0.000000e+00) + %60 = load i64, ptr %9, align 4 + %61 = and i64 %60, 4 + %.not1701 = icmp eq i64 %61, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %58 = and i64 %56, -5 - store i64 %58, ptr %5, align 4 - store i64 %55, ptr %16, align 4 - %59 = load i64, ptr %5, align 4 - %60 = and i64 %59, 8 - %.not770 = icmp eq i64 %60, 0 - br i1 %.not770, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %62 = and i64 %60, -5 + store i64 %62, ptr %9, align 4 + store i64 %59, ptr %20, align 4 + %63 = load i64, ptr %9, align 4 + %64 = and i64 %63, 8 + %.not1702 = icmp eq i64 %64, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %61 = or disjoint i64 %59, 8 - store i64 %61, ptr %5, align 4 - %62 = load i64, ptr %20, align 4 - tail call void @___rp(i64 %62, double 0x400921FB54442D18, double 0.000000e+00) - %63 = load i64, ptr %5, align 4 - %64 = and i64 %63, 8 - %.not771 = icmp eq i64 %64, 0 - br i1 %.not771, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %65 = or disjoint i64 %63, 8 + store i64 %65, ptr %9, align 4 + %66 = load i64, ptr %24, align 4 + tail call void @___rp(i64 %66, double 0x400921FB54442D18, double 0.000000e+00) + %67 = load i64, ptr %9, align 4 + %68 = and i64 %67, 8 + %.not1703 = icmp eq i64 %68, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %65 = and i64 %63, -9 - store i64 %65, ptr %5, align 4 - store i64 %62, ptr %20, align 4 - %66 = load i64, ptr %5, align 4 - %67 = and i64 %66, 512 - %.not772 = icmp eq i64 %67, 0 - br i1 %.not772, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %69 = and i64 %67, -9 + store i64 %69, ptr %9, align 4 + store i64 %66, ptr %24, align 4 + %70 = load i64, ptr %9, align 4 + %71 = and i64 %70, 512 + %.not1704 = icmp eq i64 %71, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %68 = or disjoint i64 %66, 512 - store i64 %68, ptr %5, align 4 - %69 = load i64, ptr %44, align 4 - tail call void @___rp(i64 %69, double 0x400921FB54442D18, double 0.000000e+00) - %70 = load i64, ptr %5, align 4 - %71 = and i64 %70, 512 - %.not773 = icmp eq i64 %71, 0 - br i1 %.not773, label %panic.i696, label %__barray_mask_return.exit697 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %72 = or disjoint i64 %70, 512 + store i64 %72, ptr %9, align 4 + %73 = load i64, ptr %48, align 4 + tail call void @___rp(i64 %73, double 0x400921FB54442D18, double 0.000000e+00) + %74 = load i64, ptr %9, align 4 + %75 = and i64 %74, 512 + %.not1705 = icmp eq i64 %75, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %76 = and i64 %74, -513 + store i64 %76, ptr %9, align 4 + store i64 %73, ptr %48, align 4 + br label %__barray_check_bounds.exit1620 + +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_check_bounds.exit1616: ; preds = %.thread + %77 = load i64, ptr %3, align 4 + %78 = lshr i64 %77, %"363_2.01729" + %79 = trunc i64 %78 to i1 + br i1 %79, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %72 = and i64 %70, -513 - store i64 %72, ptr %5, align 4 - store i64 %69, ptr %44, align 4 - %73 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %74 = tail call ptr @heap_alloc(i64 80) - %75 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %75, align 1 - br label %__barray_check_bounds.exit.i.i - -76: ; preds = %loop_body.i - %77 = lshr i64 %.fca.2.extract.i.i, 6 - %78 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %77 - %79 = load i64, ptr %78, align 4 - %80 = and i64 %.fca.2.extract.i.i, 63 - %81 = sub nuw nsw i64 64, %80 - %82 = lshr i64 -1, %81 - %83 = icmp eq i64 %80, 0 - %84 = select i1 %83, i64 0, i64 %82 - %85 = or i64 %79, %84 - store i64 %85, ptr %78, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %86 = lshr i64 %last_valid.i.i.i, 6 - %87 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %86 - %88 = load i64, ptr %87, align 4 - %89 = and i64 %last_valid.i.i.i, 63 - %90 = shl nsw i64 -2, %89 - %91 = icmp eq i64 %89, 63 - %92 = select i1 %91, i64 0, i64 %90 - %93 = or i64 %88, %92 - store i64 %93, ptr %87, align 4 - %reass.sub.i.i.i = sub nsw i64 %86, %77 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -94: ; preds = %mask_block_ok.i.i.i - %95 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %76, %94 - %.02.i.i.i = phi i64 [ %95, %94 ], [ 0, %76 ] - %gep.i.i.i = getelementptr i64, ptr %78, i64 %.02.i.i.i - %96 = load i64, ptr %gep.i.i.i, align 4 - %97 = icmp eq i64 %96, -1 - br i1 %97, label %94, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i +mask_block_ok.i: ; preds = %cond_exit_367 + %80 = load i64, ptr %9, align 4 + %81 = or i64 %80, -1024 + store i64 %81, ptr %9, align 4 + %82 = icmp eq i64 %81, -1 + br i1 %82, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %98, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %73, %__barray_mask_return.exit697 ], [ %113, %loop_body.i ] - %98 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %99 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %100 = lshr i64 %99, 6 - %101 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %100 - %102 = load i64, ptr %101, align 4 - %103 = and i64 %99, 63 - %104 = lshr i64 %102, %103 - %105 = trunc i64 %104 to i1 - br i1 %105, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01730" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %83, %cond_exit_367 ] + %"363_2.01729" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %91, %cond_exit_367 ] + %83 = add nuw nsw i64 %"363_0.sroa.15.01730", 1 + %84 = load i64, ptr %9, align 4 + %85 = lshr i64 %84, %"363_0.sroa.15.01730" + %86 = trunc i64 %85 to i1 + br i1 %86, label %panic.i1621, label %.thread -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %106 = shl nuw i64 1, %103 - %107 = xor i64 %106, %102 - store i64 %107, ptr %101, align 4 - %108 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %99 - %109 = load i64, ptr %108, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %109) - tail call void @___qfree(i64 %109) - %110 = load i64, ptr %75, align 4 - %111 = lshr i64 %110, %"239_0.sroa.15.0178.i" - %112 = trunc i64 %111 to i1 - br i1 %112, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %113 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %98, 1 - %114 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %115 = xor i64 %110, %114 - store i64 %115, ptr %75, align 4 - %116 = getelementptr inbounds nuw i64, ptr %74, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %116, align 4 - %117 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %117, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %117, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %117, 2 - %exitcond.not.i = icmp eq i64 %98, 10 - br i1 %exitcond.not.i, label %76, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %94, %76 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %74, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %75, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %118 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %119 = tail call ptr @heap_alloc(i64 10) - %120 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %120, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %269, 0 - %121 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %122 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %"545_1.sroa.10.0.i.i", 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %127 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %269, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %128, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %118, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %265, %loop_body.i701 ] - %128 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %127, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %127, 1 - %129 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %130 = lshr i64 %129, 6 - %131 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %130 - %132 = load i64, ptr %131, align 4 - %133 = and i64 %129, 63 - %134 = lshr i64 %132, %133 - %135 = trunc i64 %134 to i1 - br i1 %135, label %panic.i.i.i713, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i713: ; preds = %__barray_check_bounds.exit.i.i698 +.thread: ; preds = %__barray_check_bounds.exit1620 + %87 = shl nuw nsw i64 1, %"363_0.sroa.15.01730" + %88 = xor i64 %84, %87 + store i64 %88, ptr %9, align 4 + %89 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01730" + %90 = load i64, ptr %89, align 4 + %91 = add i64 %"363_2.01729", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %90) + tail call void @___qfree(i64 %90) + %92 = icmp ult i64 %"363_2.01729", 10 + br i1 %92, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %93 = shl nuw nsw i64 1, %"363_2.01729" + %94 = xor i64 %77, %93 + store i64 %94, ptr %3, align 4 + %95 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01729" + store i64 %lazy_measure, ptr %95, align 4 + %96 = icmp samesign ugt i64 %"363_0.sroa.15.01730", 8 + br i1 %96, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %97, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %97 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %98 = load i64, ptr %3, align 4 + %99 = lshr i64 %98, %"429_0.sroa.15.01708" + %100 = trunc i64 %99 to i1 + br i1 %100, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %127, 0 - %136 = shl nuw i64 1, %133 - %137 = xor i64 %136, %132 - store i64 %137, ptr %131, align 4 - %138 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %129 - %139 = load i64, ptr %138, align 4 - tail call void @___inc_future_refcount(i64 %139) - %140 = load i64, ptr %131, align 4 - %141 = lshr i64 %140, %133 - %142 = trunc i64 %141 to i1 - br i1 %142, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %101 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %102 = xor i64 %98, %101 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %104 = load i64, ptr %103, align 4 + tail call void @___inc_future_refcount(i64 %104) + %105 = load i64, ptr %3, align 4 + %106 = lshr i64 %105, %"429_0.sroa.15.01708" + %107 = trunc i64 %106 to i1 + br i1 %107, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -143: ; preds = %mask_block_ok.i.i.i705 - %144 = add nuw i64 %.02.i.i.i706, 1 - %exitcond.not.i.i.i709 = icmp eq i64 %.02.i.i.i706, %reass.sub.i.i.i703 - br i1 %exitcond.not.i.i.i709, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -mask_block_ok.i.i.i705: ; preds = %cond_exit_548.thread.9.i.i, %143 - %.02.i.i.i706 = phi i64 [ %144, %143 ], [ 0, %cond_exit_548.thread.9.i.i ] - %gep.i.i.i707 = getelementptr i64, ptr %122, i64 %.02.i.i.i706 - %145 = load i64, ptr %gep.i.i.i707, align 4 - %146 = icmp eq i64 %145, -1 - br i1 %146, label %143, label %mask_block_err.i.i.i708 - -mask_block_err.i.i.i708: ; preds = %mask_block_ok.i.i.i705 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %108 = xor i64 %105, %101 + store i64 %108, ptr %3, align 4 + store i64 %104, ptr %103, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %104) + tail call void @___dec_future_refcount(i64 %104) + %109 = load i64, ptr %1, align 4 + %110 = lshr i64 %109, %"429_0.sroa.15.01708" + %111 = trunc i64 %110 to i1 + br i1 %111, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %147 = shl nuw i64 1, %124 - %148 = xor i64 %123, %147 - store i64 %148, ptr %122, align 4 - %149 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %"545_1.sroa.10.0.i.i" - %150 = load i64, ptr %149, align 4 - tail call void @___dec_future_refcount(i64 %150) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %151 = add i64 %"545_1.sroa.10.0.i.i", 1 - %152 = lshr i64 %151, 6 - %153 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %152 - %154 = load i64, ptr %153, align 4 - %155 = and i64 %151, 63 - %156 = lshr i64 %154, %155 - %157 = trunc i64 %156 to i1 - br i1 %157, label %cond_exit_548.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_548.thread.i.i - %158 = shl nuw i64 1, %155 - %159 = xor i64 %154, %158 - store i64 %159, ptr %153, align 4 - %160 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %151 - %161 = load i64, ptr %160, align 4 - tail call void @___dec_future_refcount(i64 %161) - br label %cond_exit_548.thread.1.i.i - -cond_exit_548.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_548.thread.i.i - %162 = add i64 %"545_1.sroa.10.0.i.i", 2 - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_548.thread.1.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %165, %169 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.2.i.i - -cond_exit_548.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_548.thread.1.i.i - %173 = add i64 %"545_1.sroa.10.0.i.i", 3 - %174 = lshr i64 %173, 6 - %175 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %174 - %176 = load i64, ptr %175, align 4 - %177 = and i64 %173, 63 - %178 = lshr i64 %176, %177 - %179 = trunc i64 %178 to i1 - br i1 %179, label %cond_exit_548.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_548.thread.2.i.i - %180 = shl nuw i64 1, %177 - %181 = xor i64 %176, %180 - store i64 %181, ptr %175, align 4 - %182 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %173 - %183 = load i64, ptr %182, align 4 - tail call void @___dec_future_refcount(i64 %183) - br label %cond_exit_548.thread.3.i.i - -cond_exit_548.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_548.thread.2.i.i - %184 = add i64 %"545_1.sroa.10.0.i.i", 4 - %185 = lshr i64 %184, 6 - %186 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %185 - %187 = load i64, ptr %186, align 4 - %188 = and i64 %184, 63 - %189 = lshr i64 %187, %188 - %190 = trunc i64 %189 to i1 - br i1 %190, label %cond_exit_548.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_548.thread.3.i.i - %191 = shl nuw i64 1, %188 - %192 = xor i64 %187, %191 - store i64 %192, ptr %186, align 4 - %193 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %184 - %194 = load i64, ptr %193, align 4 - tail call void @___dec_future_refcount(i64 %194) - br label %cond_exit_548.thread.4.i.i - -cond_exit_548.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_548.thread.3.i.i - %195 = add i64 %"545_1.sroa.10.0.i.i", 5 - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_548.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_548.thread.4.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %198, %202 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_548.thread.5.i.i - -cond_exit_548.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_548.thread.4.i.i - %206 = add i64 %"545_1.sroa.10.0.i.i", 6 - %207 = lshr i64 %206, 6 - %208 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %207 - %209 = load i64, ptr %208, align 4 - %210 = and i64 %206, 63 - %211 = lshr i64 %209, %210 - %212 = trunc i64 %211 to i1 - br i1 %212, label %cond_exit_548.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_548.thread.5.i.i - %213 = shl nuw i64 1, %210 - %214 = xor i64 %209, %213 - store i64 %214, ptr %208, align 4 - %215 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %206 - %216 = load i64, ptr %215, align 4 - tail call void @___dec_future_refcount(i64 %216) - br label %cond_exit_548.thread.6.i.i - -cond_exit_548.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_548.thread.5.i.i - %217 = add i64 %"545_1.sroa.10.0.i.i", 7 - %218 = lshr i64 %217, 6 - %219 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %218 - %220 = load i64, ptr %219, align 4 - %221 = and i64 %217, 63 - %222 = lshr i64 %220, %221 - %223 = trunc i64 %222 to i1 - br i1 %223, label %cond_exit_548.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_548.thread.6.i.i - %224 = shl nuw i64 1, %221 - %225 = xor i64 %220, %224 - store i64 %225, ptr %219, align 4 - %226 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %217 - %227 = load i64, ptr %226, align 4 - tail call void @___dec_future_refcount(i64 %227) - br label %cond_exit_548.thread.7.i.i - -cond_exit_548.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_548.thread.6.i.i - %228 = add i64 %"545_1.sroa.10.0.i.i", 8 - %229 = lshr i64 %228, 6 - %230 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %229 - %231 = load i64, ptr %230, align 4 - %232 = and i64 %228, 63 - %233 = lshr i64 %231, %232 - %234 = trunc i64 %233 to i1 - br i1 %234, label %cond_exit_548.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_548.thread.7.i.i - %235 = shl nuw i64 1, %232 - %236 = xor i64 %231, %235 - store i64 %236, ptr %230, align 4 - %237 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %228 - %238 = load i64, ptr %237, align 4 - tail call void @___dec_future_refcount(i64 %238) - br label %cond_exit_548.thread.8.i.i - -cond_exit_548.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_548.thread.7.i.i - %239 = add i64 %"545_1.sroa.10.0.i.i", 9 - %240 = lshr i64 %239, 6 - %241 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %240 - %242 = load i64, ptr %241, align 4 - %243 = and i64 %239, 63 - %244 = lshr i64 %242, %243 - %245 = trunc i64 %244 to i1 - br i1 %245, label %cond_exit_548.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_548.thread.8.i.i - %246 = shl nuw i64 1, %243 - %247 = xor i64 %242, %246 - store i64 %247, ptr %241, align 4 - %248 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %239 - %249 = load i64, ptr %248, align 4 - tail call void @___dec_future_refcount(i64 %249) - br label %cond_exit_548.thread.9.i.i - -cond_exit_548.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_548.thread.8.i.i - %250 = load i64, ptr %122, align 4 - %251 = sub nuw nsw i64 64, %124 - %252 = lshr i64 -1, %251 - %253 = icmp eq i64 %124, 0 - %254 = select i1 %253, i64 0, i64 %252 - %255 = or i64 %250, %254 - store i64 %255, ptr %122, align 4 - %256 = load i64, ptr %241, align 4 - %257 = shl nsw i64 -2, %243 - %258 = icmp eq i64 %243, 63 - %259 = select i1 %258, i64 0, i64 %257 - %260 = or i64 %256, %259 - store i64 %260, ptr %241, align 4 - %reass.sub.i.i.i703 = sub nsw i64 %240, %121 - %.not.i.i.i704 = icmp eq i64 %reass.sub.i.i.i703, -1 - br i1 %.not.i.i.i704, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i705 - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %261 = xor i64 %140, %136 - store i64 %261, ptr %131, align 4 - store i64 %139, ptr %138, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %139) - tail call void @___dec_future_refcount(i64 %139) - %262 = load i64, ptr %120, align 4 - %263 = lshr i64 %262, %"280_0.sroa.15.0168.i" - %264 = trunc i64 %263 to i1 - br i1 %264, label %loop_body.i701, label %panic.i.i700 - -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %265 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %128, 1 - %266 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %267 = xor i64 %262, %266 - store i64 %267, ptr %120, align 4 - %268 = getelementptr inbounds nuw i1, ptr %119, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %268, align 1 - %269 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %128, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %143, %cond_exit_548.thread.9.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %270 = load i64, ptr %120, align 4 - %271 = and i64 %270, 1023 - store i64 %271, ptr %120, align 4 - %272 = icmp eq i64 %271, 0 - br i1 %272, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %273 = tail call ptr @heap_alloc(i64 10) - %274 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %274, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %273, ptr noundef nonnull align 1 dereferenceable(10) %119, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %273) - %275 = load i64, ptr %120, align 4 - %276 = and i64 %275, 1023 - store i64 %276, ptr %120, align 4 - %277 = icmp eq i64 %276, 0 - br i1 %277, label %__barray_check_none_borrowed.exit719, label %mask_block_err.i717 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %112 = or disjoint i64 %165, 1 + store i64 %112, ptr %3, align 4 + %113 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %113) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %114 = load i64, ptr %3, align 4 + %115 = and i64 %114, 2 + %.not1732 = icmp eq i64 %115, 0 + br i1 %.not1732, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %116 = or disjoint i64 %114, 2 + store i64 %116, ptr %3, align 4 + %117 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %118 = load i64, ptr %117, align 4 + tail call void @___dec_future_refcount(i64 %118) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %119 = load i64, ptr %3, align 4 + %120 = and i64 %119, 4 + %.not1733 = icmp eq i64 %120, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %121 = or disjoint i64 %119, 4 + store i64 %121, ptr %3, align 4 + %122 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %123 = load i64, ptr %122, align 4 + tail call void @___dec_future_refcount(i64 %123) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %124 = load i64, ptr %3, align 4 + %125 = and i64 %124, 8 + %.not1734 = icmp eq i64 %125, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %126 = or disjoint i64 %124, 8 + store i64 %126, ptr %3, align 4 + %127 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %128 = load i64, ptr %127, align 4 + tail call void @___dec_future_refcount(i64 %128) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %129 = load i64, ptr %3, align 4 + %130 = and i64 %129, 16 + %.not1735 = icmp eq i64 %130, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %131 = or disjoint i64 %129, 16 + store i64 %131, ptr %3, align 4 + %132 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %133 = load i64, ptr %132, align 4 + tail call void @___dec_future_refcount(i64 %133) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %134 = load i64, ptr %3, align 4 + %135 = and i64 %134, 32 + %.not1736 = icmp eq i64 %135, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %136 = or disjoint i64 %134, 32 + store i64 %136, ptr %3, align 4 + %137 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %138 = load i64, ptr %137, align 4 + tail call void @___dec_future_refcount(i64 %138) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %139 = load i64, ptr %3, align 4 + %140 = and i64 %139, 64 + %.not1737 = icmp eq i64 %140, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %141 = or disjoint i64 %139, 64 + store i64 %141, ptr %3, align 4 + %142 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %143 = load i64, ptr %142, align 4 + tail call void @___dec_future_refcount(i64 %143) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %144 = load i64, ptr %3, align 4 + %145 = and i64 %144, 128 + %.not1738 = icmp eq i64 %145, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %146 = or disjoint i64 %144, 128 + store i64 %146, ptr %3, align 4 + %147 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %148 = load i64, ptr %147, align 4 + tail call void @___dec_future_refcount(i64 %148) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %149 = load i64, ptr %3, align 4 + %150 = and i64 %149, 256 + %.not1739 = icmp eq i64 %150, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %151 = or disjoint i64 %149, 256 + store i64 %151, ptr %3, align 4 + %152 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %153 = load i64, ptr %152, align 4 + tail call void @___dec_future_refcount(i64 %153) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %154 = load i64, ptr %3, align 4 + %155 = and i64 %154, 512 + %.not1740 = icmp eq i64 %155, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %156 = or disjoint i64 %154, 512 + store i64 %156, ptr %3, align 4 + %157 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %158 = load i64, ptr %157, align 4 + tail call void @___dec_future_refcount(i64 %158) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %159 = load i64, ptr %3, align 4 + %160 = or i64 %159, -1024 + store i64 %160, ptr %3, align 4 + %161 = icmp eq i64 %160, -1 + br i1 %161, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %162 = xor i64 %109, %101 + store i64 %162, ptr %1, align 4 + %163 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %163, align 1 + %164 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %164, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %165 = load i64, ptr %3, align 4 + %166 = trunc i64 %165 to i1 + br i1 %166, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %167 = load i64, ptr %1, align 4 + %168 = and i64 %167, 1023 + store i64 %168, ptr %1, align 4 + %169 = icmp eq i64 %168, 0 + br i1 %169, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %170 = tail call ptr @heap_alloc(i64 10) + %171 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %171, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %170, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %170) + %172 = load i64, ptr %1, align 4 + %173 = and i64 %172, 1023 + store i64 %173, ptr %1, align 4 + %174 = icmp eq i64 %173, 0 + br i1 %174, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit719: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %278 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %278, i8 0, i64 10, i1 false) + %175 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %175, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %119, ptr %arr_ptr, align 8 - store ptr %278, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %175, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit727 + br label %__barray_check_bounds.exit1657 -mask_block_err.i717: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit727: ; preds = %cond_exit_94, %__barray_check_none_borrowed.exit719 - %"89_0.sroa.0.0777" = phi i64 [ 0, %__barray_check_none_borrowed.exit719 ], [ %285, %cond_exit_94 ] - %279 = lshr i64 %"89_0.sroa.0.0777", 6 - %280 = getelementptr inbounds nuw i64, ptr %3, i64 %279 - %281 = load i64, ptr %280, align 4 - %282 = and i64 %"89_0.sroa.0.0777", 63 - %283 = lshr i64 %281, %282 - %284 = trunc i64 %283 to i1 - br i1 %284, label %cond_exit_94, label %panic.i728 - -panic.i728: ; preds = %__barray_check_bounds.exit727 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %182, %cond_exit_147 ] + %176 = lshr i64 %"143_2.01709", 6 + %177 = getelementptr inbounds nuw i64, ptr %7, i64 %176 + %178 = load i64, ptr %177, align 4 + %179 = and i64 %"143_2.01709", 63 + %180 = lshr i64 %178, %179 + %181 = trunc i64 %180 to i1 + br i1 %181, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit727 - %285 = add nuw nsw i64 %"89_0.sroa.0.0777", 1 - %286 = shl nuw i64 1, %282 - %287 = xor i64 %281, %286 - store i64 %287, ptr %280, align 4 - %288 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0777" - store i64 %"89_0.sroa.0.0777", ptr %288, align 4 - %exitcond.not = icmp eq i64 %285, 100 - br i1 %exitcond.not, label %loop_out127, label %__barray_check_bounds.exit727 - -loop_out127: ; preds = %cond_exit_94 - %289 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %290 = load i64, ptr %289, align 4 - %291 = and i64 %290, 68719476735 - store i64 %291, ptr %289, align 4 - %292 = load i64, ptr %3, align 4 - %293 = icmp eq i64 %292, 0 - %294 = icmp eq i64 %291, 0 - %or.cond = select i1 %293, i1 %294, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit734, label %mask_block_err.i732 - -__barray_check_none_borrowed.exit734: ; preds = %loop_out127 - %295 = call ptr @heap_alloc(i64 800) - %296 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %296, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %295, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %295) - %297 = load i64, ptr %289, align 4 - %298 = and i64 %297, 68719476735 - store i64 %298, ptr %289, align 4 - %299 = load i64, ptr %3, align 4 - %300 = icmp eq i64 %299, 0 - %301 = icmp eq i64 %298, 0 - %or.cond790 = select i1 %300, i1 %301, i1 false - br i1 %or.cond790, label %__barray_check_none_borrowed.exit739, label %mask_block_err.i737 - -mask_block_err.i732: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %182 = add nuw nsw i64 %"143_2.01709", 1 + %183 = shl nuw i64 1, %179 + %184 = xor i64 %178, %183 + store i64 %184, ptr %177, align 4 + %185 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %185, align 4 + %exitcond = icmp eq i64 %182, 100 + br i1 %exitcond, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147 + %186 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %187 = load i64, ptr %186, align 4 + %188 = and i64 %187, 68719476735 + store i64 %188, ptr %186, align 4 + %189 = load i64, ptr %7, align 4 + %190 = icmp eq i64 %189, 0 + %191 = icmp eq i64 %188, 0 + %or.cond = select i1 %190, i1 %191, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %192 = call ptr @heap_alloc(i64 800) + %193 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %193, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %192, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %192) + %194 = load i64, ptr %186, align 4 + %195 = and i64 %194, 68719476735 + store i64 %195, ptr %186, align 4 + %196 = load i64, ptr %7, align 4 + %197 = icmp eq i64 %196, 0 + %198 = icmp eq i64 %195, 0 + %or.cond1726 = select i1 %197, i1 %198, i1 false + br i1 %or.cond1726, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit739: ; preds = %__barray_check_none_borrowed.exit734 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %302 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %302, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %302, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit747 - -mask_block_err.i737: ; preds = %__barray_check_none_borrowed.exit734 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %199 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %199, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %199, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit747: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit739 - %"124_0.sroa.0.0779" = phi i64 [ 0, %__barray_check_none_borrowed.exit739 ], [ %311, %cond_exit_129 ] - %303 = lshr i64 %"124_0.sroa.0.0779", 6 - %304 = getelementptr inbounds nuw i64, ptr %1, i64 %303 - %305 = load i64, ptr %304, align 4 - %306 = and i64 %"124_0.sroa.0.0779", 63 - %307 = lshr i64 %305, %306 - %308 = trunc i64 %307 to i1 - br i1 %308, label %cond_exit_129, label %panic.i748 - -panic.i748: ; preds = %__barray_check_bounds.exit747 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %208, %cond_exit_253 ] + %200 = lshr i64 %"249_2.01711", 6 + %201 = getelementptr inbounds nuw i64, ptr %5, i64 %200 + %202 = load i64, ptr %201, align 4 + %203 = and i64 %"249_2.01711", 63 + %204 = lshr i64 %202, %203 + %205 = trunc i64 %204 to i1 + br i1 %205, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit747 - %309 = uitofp nneg i64 %"124_0.sroa.0.0779" to double - %310 = fmul double %309, 6.250000e-02 - %311 = add nuw nsw i64 %"124_0.sroa.0.0779", 1 - %312 = shl nuw i64 1, %306 - %313 = xor i64 %305, %312 - store i64 %313, ptr %304, align 4 - %314 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0779" - store double %310, ptr %314, align 8 - %exitcond780.not = icmp eq i64 %311, 100 - br i1 %exitcond780.not, label %loop_out211, label %__barray_check_bounds.exit747 - -loop_out211: ; preds = %cond_exit_129 - %315 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %316 = load i64, ptr %315, align 4 - %317 = and i64 %316, 68719476735 - store i64 %317, ptr %315, align 4 - %318 = load i64, ptr %1, align 4 - %319 = icmp eq i64 %318, 0 - %320 = icmp eq i64 %317, 0 - %or.cond791 = select i1 %319, i1 %320, i1 false - br i1 %or.cond791, label %__barray_check_none_borrowed.exit754, label %mask_block_err.i752 - -__barray_check_none_borrowed.exit754: ; preds = %loop_out211 - %321 = call ptr @heap_alloc(i64 800) - %322 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %322, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %321, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %321) - %323 = load i64, ptr %315, align 4 - %324 = and i64 %323, 68719476735 - store i64 %324, ptr %315, align 4 - %325 = load i64, ptr %1, align 4 - %326 = icmp eq i64 %325, 0 - %327 = icmp eq i64 %324, 0 - %or.cond792 = select i1 %326, i1 %327, i1 false - br i1 %or.cond792, label %__barray_check_none_borrowed.exit759, label %mask_block_err.i757 - -mask_block_err.i752: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %206 = uitofp nneg i64 %"249_2.01711" to double + %207 = fmul double %206, 6.250000e-02 + %208 = add nuw nsw i64 %"249_2.01711", 1 + %209 = shl nuw i64 1, %203 + %210 = xor i64 %202, %209 + store i64 %210, ptr %201, align 4 + %211 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %207, ptr %211, align 8 + %exitcond1713 = icmp eq i64 %208, 100 + br i1 %exitcond1713, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %212 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %213 = load i64, ptr %212, align 4 + %214 = and i64 %213, 68719476735 + store i64 %214, ptr %212, align 4 + %215 = load i64, ptr %5, align 4 + %216 = icmp eq i64 %215, 0 + %217 = icmp eq i64 %214, 0 + %or.cond1727 = select i1 %216, i1 %217, i1 false + br i1 %or.cond1727, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %218 = call ptr @heap_alloc(i64 800) + %219 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %219, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %218, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %218) + %220 = load i64, ptr %212, align 4 + %221 = and i64 %220, 68719476735 + store i64 %221, ptr %212, align 4 + %222 = load i64, ptr %5, align 4 + %223 = icmp eq i64 %222, 0 + %224 = icmp eq i64 %221, 0 + %or.cond1728 = select i1 %223, i1 %224, i1 false + br i1 %or.cond1728, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit759: ; preds = %__barray_check_none_borrowed.exit754 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %328 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %328, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %328, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %225 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %225, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %225, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i757: ; preds = %__barray_check_none_borrowed.exit754 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -895,26 +766,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-apple-darwin.ll index d4ae8765..b269d724 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-apple-darwin.ll @@ -3,750 +3,775 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__barray_check_bounds.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not786 = icmp eq i64 %10, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1724 = icmp eq i64 %14, 0 + br i1 %.not1724, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not787 = icmp eq i64 %14, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1725 = icmp eq i64 %18, 0 + br i1 %.not1725, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not788 = icmp eq i64 %18, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1726 = icmp eq i64 %22, 0 + br i1 %.not1726, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not789 = icmp eq i64 %22, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1727 = icmp eq i64 %26, 0 + br i1 %.not1727, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not790 = icmp eq i64 %26, 0 - br i1 %.not790, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1728 = icmp eq i64 %30, 0 + br i1 %.not1728, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not791 = icmp eq i64 %30, 0 - br i1 %.not791, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1729 = icmp eq i64 %34, 0 + br i1 %.not1729, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not792 = icmp eq i64 %34, 0 - br i1 %.not792, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1730 = icmp eq i64 %38, 0 + br i1 %.not1730, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not793 = icmp eq i64 %38, 0 - br i1 %.not793, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1731 = icmp eq i64 %42, 0 + br i1 %.not1731, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not794 = icmp eq i64 %42, 0 - br i1 %.not794, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1732 = icmp eq i64 %46, 0 + br i1 %.not1732, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %56 = load i64, ptr %55, align 4 - tail call void @___rp(i64 %56, double 0x400921FB54442D18, double 0.000000e+00) - %57 = load i64, ptr %5, align 4 - %58 = and i64 %57, 4 - %.not770 = icmp eq i64 %58, 0 - br i1 %.not770, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %60 = load i64, ptr %59, align 4 + tail call void @___rp(i64 %60, double 0x400921FB54442D18, double 0.000000e+00) + %61 = load i64, ptr %9, align 4 + %62 = and i64 %61, 4 + %.not1701 = icmp eq i64 %62, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %59 = and i64 %57, -5 - store i64 %59, ptr %5, align 4 - store i64 %56, ptr %55, align 4 - %60 = load i64, ptr %5, align 4 - %61 = and i64 %60, 8 - %.not771 = icmp eq i64 %61, 0 - br i1 %.not771, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %63 = and i64 %61, -5 + store i64 %63, ptr %9, align 4 + store i64 %60, ptr %59, align 4 + %64 = load i64, ptr %9, align 4 + %65 = and i64 %64, 8 + %.not1702 = icmp eq i64 %65, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %62 = or disjoint i64 %60, 8 - store i64 %62, ptr %5, align 4 - %63 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %64 = load i64, ptr %63, align 4 - tail call void @___rp(i64 %64, double 0x400921FB54442D18, double 0.000000e+00) - %65 = load i64, ptr %5, align 4 - %66 = and i64 %65, 8 - %.not772 = icmp eq i64 %66, 0 - br i1 %.not772, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %66 = or disjoint i64 %64, 8 + store i64 %66, ptr %9, align 4 + %67 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %68 = load i64, ptr %67, align 4 + tail call void @___rp(i64 %68, double 0x400921FB54442D18, double 0.000000e+00) + %69 = load i64, ptr %9, align 4 + %70 = and i64 %69, 8 + %.not1703 = icmp eq i64 %70, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %67 = and i64 %65, -9 - store i64 %67, ptr %5, align 4 - store i64 %64, ptr %63, align 4 - %68 = load i64, ptr %5, align 4 - %69 = and i64 %68, 512 - %.not773 = icmp eq i64 %69, 0 - br i1 %.not773, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %71 = and i64 %69, -9 + store i64 %71, ptr %9, align 4 + store i64 %68, ptr %67, align 4 + %72 = load i64, ptr %9, align 4 + %73 = and i64 %72, 512 + %.not1704 = icmp eq i64 %73, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %70 = or disjoint i64 %68, 512 - store i64 %70, ptr %5, align 4 - %71 = getelementptr inbounds nuw i8, ptr %4, i64 72 - %72 = load i64, ptr %71, align 4 - tail call void @___rp(i64 %72, double 0x400921FB54442D18, double 0.000000e+00) - %73 = load i64, ptr %5, align 4 - %74 = and i64 %73, 512 - %.not774 = icmp eq i64 %74, 0 - br i1 %.not774, label %panic.i696, label %__barray_mask_return.exit697 - -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %74 = or disjoint i64 %72, 512 + store i64 %74, ptr %9, align 4 + %75 = getelementptr inbounds nuw i8, ptr %8, i64 72 + %76 = load i64, ptr %75, align 4 + tail call void @___rp(i64 %76, double 0x400921FB54442D18, double 0.000000e+00) + %77 = load i64, ptr %9, align 4 + %78 = and i64 %77, 512 + %.not1705 = icmp eq i64 %78, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %75 = and i64 %73, -513 - store i64 %75, ptr %5, align 4 - store i64 %72, ptr %71, align 4 - %76 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %77 = tail call ptr @heap_alloc(i64 80) - %78 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %78, align 1 - br label %__barray_check_bounds.exit.i.i - -79: ; preds = %loop_body.i - %80 = lshr i64 %.fca.2.extract.i.i, 6 - %81 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %.fca.2.extract.i.i, 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %89 = lshr i64 %last_valid.i.i.i, 6 - %90 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i = sub nsw i64 %89, %80 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -97: ; preds = %mask_block_ok.i.i.i - %98 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %79, %97 - %.02.i.i.i = phi i64 [ %98, %97 ], [ 0, %79 ] - %gep.i.i.i = getelementptr i64, ptr %81, i64 %.02.i.i.i - %99 = load i64, ptr %gep.i.i.i, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %79 = and i64 %77, -513 + store i64 %79, ptr %9, align 4 + store i64 %76, ptr %75, align 4 + br label %__barray_check_bounds.exit1620 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %101, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %76, %__barray_mask_return.exit697 ], [ %116, %loop_body.i ] - %101 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %102 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %102 - %112 = load i64, ptr %111, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %78, align 4 - %114 = lshr i64 %113, %"239_0.sroa.15.0178.i" - %115 = trunc i64 %114 to i1 - br i1 %115, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1616: ; preds = %.thread + %80 = load i64, ptr %3, align 4 + %81 = lshr i64 %80, %"363_2.01721" + %82 = trunc i64 %81 to i1 + br i1 %82, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %116 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %101, 1 - %117 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %118 = xor i64 %113, %117 - store i64 %118, ptr %78, align 4 - %119 = getelementptr inbounds nuw i64, ptr %77, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %119, align 4 - %120 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %120, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %120, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %120, 2 - %exitcond.not.i = icmp eq i64 %101, 10 - br i1 %exitcond.not.i, label %79, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %97, %79 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %77, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %78, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %121 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %122 = tail call ptr @heap_alloc(i64 10) - %123 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %123, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %181, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %125, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %121, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %177, %loop_body.i701 ] - %125 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i714, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i714: ; preds = %__barray_check_bounds.exit.i.i698 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_ok.i: ; preds = %cond_exit_367 + %83 = load i64, ptr %9, align 4 + %84 = or i64 %83, -1024 + store i64 %84, ptr %9, align 4 + %85 = icmp eq i64 %84, -1 + br i1 %85, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01722" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %86, %cond_exit_367 ] + %"363_2.01721" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %94, %cond_exit_367 ] + %86 = add nuw nsw i64 %"363_0.sroa.15.01722", 1 + %87 = load i64, ptr %9, align 4 + %88 = lshr i64 %87, %"363_0.sroa.15.01722" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1621, label %.thread -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_548_case_0.i.i: ; preds = %cond_exit_548.thread.i.i - %140 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %141 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %140 - %142 = load i64, ptr %141, align 4 - %143 = and i64 %"545_1.sroa.10.0.i.i", 63 - %144 = sub nuw nsw i64 64, %143 - %145 = lshr i64 -1, %144 - %146 = icmp eq i64 %143, 0 - %147 = select i1 %146, i64 0, i64 %145 - %148 = or i64 %142, %147 - store i64 %148, ptr %141, align 4 - %last_valid.i.i.i703 = add i64 %"545_1.sroa.10.0.i.i", 9 - %149 = lshr i64 %last_valid.i.i.i703, 6 - %150 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %last_valid.i.i.i703, 63 - %153 = shl nsw i64 -2, %152 - %154 = icmp eq i64 %152, 63 - %155 = select i1 %154, i64 0, i64 %153 - %156 = or i64 %151, %155 - store i64 %156, ptr %150, align 4 - %reass.sub.i.i.i704 = sub nsw i64 %149, %140 - %.not.i.i.i705 = icmp eq i64 %reass.sub.i.i.i704, -1 - br i1 %.not.i.i.i705, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -157: ; preds = %mask_block_ok.i.i.i706 - %158 = add nuw i64 %.02.i.i.i707, 1 - %exitcond.not.i.i.i710 = icmp eq i64 %.02.i.i.i707, %reass.sub.i.i.i704 - br i1 %exitcond.not.i.i.i710, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -mask_block_ok.i.i.i706: ; preds = %cond_548_case_0.i.i, %157 - %.02.i.i.i707 = phi i64 [ %158, %157 ], [ 0, %cond_548_case_0.i.i ] - %gep.i.i.i708 = getelementptr i64, ptr %141, i64 %.02.i.i.i707 - %159 = load i64, ptr %gep.i.i.i708, align 4 - %160 = icmp eq i64 %159, -1 - br i1 %160, label %157, label %mask_block_err.i.i.i709 - -mask_block_err.i.i.i709: ; preds = %mask_block_ok.i.i.i706 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +.thread: ; preds = %__barray_check_bounds.exit1620 + %90 = shl nuw nsw i64 1, %"363_0.sroa.15.01722" + %91 = xor i64 %87, %90 + store i64 %91, ptr %9, align 4 + %92 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01722" + %93 = load i64, ptr %92, align 4 + %94 = add i64 %"363_2.01721", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %93) + tail call void @___qfree(i64 %93) + %95 = icmp ult i64 %"363_2.01721", 10 + br i1 %95, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %96 = shl nuw nsw i64 1, %"363_2.01721" + %97 = xor i64 %80, %96 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01721" + store i64 %lazy_measure, ptr %98, align 4 + %99 = icmp samesign ugt i64 %"363_0.sroa.15.01722", 8 + br i1 %99, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %100, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %100 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %101 = load i64, ptr %3, align 4 + %102 = lshr i64 %101, %"429_0.sroa.15.01708" + %103 = trunc i64 %102 to i1 + br i1 %103, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_548.thread.i.i, %loop_body.preheader.i.i - %"545_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %161, %cond_exit_548.thread.i.i ] - %161 = add nuw nsw i64 %"545_0.0239.i.i", 1 - %162 = add i64 %"545_0.0239.i.i", %"545_1.sroa.10.0.i.i" - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %169, %165 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %161, 10 - br i1 %exitcond.i.i, label %cond_548_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %173 = xor i64 %137, %133 - store i64 %173, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - %174 = load i64, ptr %123, align 4 - %175 = lshr i64 %174, %"280_0.sroa.15.0168.i" - %176 = trunc i64 %175 to i1 - br i1 %176, label %loop_body.i701, label %panic.i.i700 +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %104 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %105 = xor i64 %101, %104 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %107 = load i64, ptr %106, align 4 + tail call void @___inc_future_refcount(i64 %107) + %108 = load i64, ptr %3, align 4 + %109 = lshr i64 %108, %"429_0.sroa.15.01708" + %110 = trunc i64 %109 to i1 + br i1 %110, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %111 = xor i64 %108, %104 + store i64 %111, ptr %3, align 4 + store i64 %107, ptr %106, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %107) + tail call void @___dec_future_refcount(i64 %107) + %112 = load i64, ptr %1, align 4 + %113 = lshr i64 %112, %"429_0.sroa.15.01708" + %114 = trunc i64 %113 to i1 + br i1 %114, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %177 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %178 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %179 = xor i64 %174, %178 - store i64 %179, ptr %123, align 4 - %180 = getelementptr inbounds nuw i1, ptr %122, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %180, align 1 - %181 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %157, %cond_548_case_0.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %182 = load i64, ptr %123, align 4 - %183 = and i64 %182, 1023 - store i64 %183, ptr %123, align 4 - %184 = icmp eq i64 %183, 0 - br i1 %184, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %185 = tail call ptr @heap_alloc(i64 10) - %186 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %186, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %185, ptr noundef nonnull align 1 dereferenceable(10) %122, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %185) - %187 = load i64, ptr %123, align 4 - %188 = and i64 %187, 1023 - store i64 %188, ptr %123, align 4 - %189 = icmp eq i64 %188, 0 - br i1 %189, label %__barray_check_none_borrowed.exit720, label %mask_block_err.i718 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %115 = or disjoint i64 %168, 1 + store i64 %115, ptr %3, align 4 + %116 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 2 + %.not1733 = icmp eq i64 %118, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %119 = or disjoint i64 %117, 2 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 4 + %.not1734 = icmp eq i64 %123, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %124 = or disjoint i64 %122, 4 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 8 + %.not1735 = icmp eq i64 %128, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %129 = or disjoint i64 %127, 8 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 16 + %.not1736 = icmp eq i64 %133, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %134 = or disjoint i64 %132, 16 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 32 + %.not1737 = icmp eq i64 %138, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %139 = or disjoint i64 %137, 32 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 64 + %.not1738 = icmp eq i64 %143, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %144 = or disjoint i64 %142, 64 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 128 + %.not1739 = icmp eq i64 %148, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %149 = or disjoint i64 %147, 128 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 256 + %.not1740 = icmp eq i64 %153, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %154 = or disjoint i64 %152, 256 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %157 = load i64, ptr %3, align 4 + %158 = and i64 %157, 512 + %.not1741 = icmp eq i64 %158, 0 + br i1 %.not1741, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %159 = or disjoint i64 %157, 512 + store i64 %159, ptr %3, align 4 + %160 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %162 = load i64, ptr %3, align 4 + %163 = or i64 %162, -1024 + store i64 %163, ptr %3, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %165 = xor i64 %112, %104 + store i64 %165, ptr %1, align 4 + %166 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %166, align 1 + %167 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %167, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %168 = load i64, ptr %3, align 4 + %169 = trunc i64 %168 to i1 + br i1 %169, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %173 = tail call ptr @heap_alloc(i64 10) + %174 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %174, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %173) + %175 = load i64, ptr %1, align 4 + %176 = and i64 %175, 1023 + store i64 %176, ptr %1, align 4 + %177 = icmp eq i64 %176, 0 + br i1 %177, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit720: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %190 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %190, i8 0, i64 10, i1 false) + %178 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %178, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %122, ptr %arr_ptr, align 8 - store ptr %190, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %178, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit728 + br label %__barray_check_bounds.exit1657 -mask_block_err.i718: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit728: ; preds = %cond_exit_94.1, %__barray_check_none_borrowed.exit720 - %"89_0.sroa.0.0778" = phi i64 [ 0, %__barray_check_none_borrowed.exit720 ], [ %207, %cond_exit_94.1 ] - %191 = lshr i64 %"89_0.sroa.0.0778", 6 - %192 = getelementptr inbounds nuw i64, ptr %3, i64 %191 - %193 = load i64, ptr %192, align 4 - %194 = and i64 %"89_0.sroa.0.0778", 62 - %195 = lshr i64 %193, %194 - %196 = trunc i64 %195 to i1 - br i1 %196, label %cond_exit_94, label %panic.i729 - -panic.i729: ; preds = %cond_exit_94, %__barray_check_bounds.exit728 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147.1, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %195, %cond_exit_147.1 ] + %179 = lshr i64 %"143_2.01709", 6 + %180 = getelementptr inbounds nuw i64, ptr %7, i64 %179 + %181 = load i64, ptr %180, align 4 + %182 = and i64 %"143_2.01709", 62 + %183 = lshr i64 %181, %182 + %184 = trunc i64 %183 to i1 + br i1 %184, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %cond_exit_147, %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit728 - %197 = or disjoint i64 %"89_0.sroa.0.0778", 1 - %198 = shl nuw nsw i64 1, %194 - %199 = xor i64 %193, %198 - store i64 %199, ptr %192, align 4 - %200 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0778" - store i64 %"89_0.sroa.0.0778", ptr %200, align 4 - %201 = lshr i64 %"89_0.sroa.0.0778", 6 - %202 = getelementptr inbounds nuw i64, ptr %3, i64 %201 - %203 = load i64, ptr %202, align 4 - %204 = and i64 %197, 63 - %205 = lshr i64 %203, %204 - %206 = trunc i64 %205 to i1 - br i1 %206, label %cond_exit_94.1, label %panic.i729 - -cond_exit_94.1: ; preds = %cond_exit_94 - %207 = add nuw nsw i64 %"89_0.sroa.0.0778", 2 - %208 = shl nuw i64 1, %204 - %209 = xor i64 %203, %208 - store i64 %209, ptr %202, align 4 - %210 = getelementptr inbounds nuw i64, ptr %2, i64 %197 - store i64 %197, ptr %210, align 4 - %exitcond781.not.1 = icmp eq i64 %207, 100 - br i1 %exitcond781.not.1, label %loop_out127, label %__barray_check_bounds.exit728 - -loop_out127: ; preds = %cond_exit_94.1 - %211 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %212 = load i64, ptr %211, align 4 - %213 = and i64 %212, 68719476735 - store i64 %213, ptr %211, align 4 - %214 = load i64, ptr %3, align 4 - %215 = icmp eq i64 %214, 0 - %216 = icmp eq i64 %213, 0 - %or.cond = select i1 %215, i1 %216, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit735, label %mask_block_err.i733 - -__barray_check_none_borrowed.exit735: ; preds = %loop_out127 - %217 = call ptr @heap_alloc(i64 800) - %218 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %218, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %217, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %217) - %219 = load i64, ptr %211, align 4 - %220 = and i64 %219, 68719476735 - store i64 %220, ptr %211, align 4 - %221 = load i64, ptr %3, align 4 - %222 = icmp eq i64 %221, 0 - %223 = icmp eq i64 %220, 0 - %or.cond783 = select i1 %222, i1 %223, i1 false - br i1 %or.cond783, label %__barray_check_none_borrowed.exit740, label %mask_block_err.i738 - -mask_block_err.i733: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %185 = or disjoint i64 %"143_2.01709", 1 + %186 = shl nuw nsw i64 1, %182 + %187 = xor i64 %181, %186 + store i64 %187, ptr %180, align 4 + %188 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %188, align 4 + %189 = lshr i64 %"143_2.01709", 6 + %190 = getelementptr inbounds nuw i64, ptr %7, i64 %189 + %191 = load i64, ptr %190, align 4 + %192 = and i64 %185, 63 + %193 = lshr i64 %191, %192 + %194 = trunc i64 %193 to i1 + br i1 %194, label %cond_exit_147.1, label %panic.i1658 + +cond_exit_147.1: ; preds = %cond_exit_147 + %195 = add nuw nsw i64 %"143_2.01709", 2 + %196 = shl nuw i64 1, %192 + %197 = xor i64 %191, %196 + store i64 %197, ptr %190, align 4 + %198 = getelementptr inbounds nuw i64, ptr %6, i64 %185 + store i64 %185, ptr %198, align 4 + %exitcond1713.1 = icmp eq i64 %195, 100 + br i1 %exitcond1713.1, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147.1 + %199 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %200 = load i64, ptr %199, align 4 + %201 = and i64 %200, 68719476735 + store i64 %201, ptr %199, align 4 + %202 = load i64, ptr %7, align 4 + %203 = icmp eq i64 %202, 0 + %204 = icmp eq i64 %201, 0 + %or.cond = select i1 %203, i1 %204, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %205 = call ptr @heap_alloc(i64 800) + %206 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %206, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %205, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %205) + %207 = load i64, ptr %199, align 4 + %208 = and i64 %207, 68719476735 + store i64 %208, ptr %199, align 4 + %209 = load i64, ptr %7, align 4 + %210 = icmp eq i64 %209, 0 + %211 = icmp eq i64 %208, 0 + %or.cond1718 = select i1 %210, i1 %211, i1 false + br i1 %or.cond1718, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit740: ; preds = %__barray_check_none_borrowed.exit735 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %224 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %224, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %224, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit748 - -mask_block_err.i738: ; preds = %__barray_check_none_borrowed.exit735 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %212 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %212, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %212, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit748: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit740 - %"124_0.sroa.0.0780" = phi i64 [ 0, %__barray_check_none_borrowed.exit740 ], [ %233, %cond_exit_129 ] - %225 = lshr i64 %"124_0.sroa.0.0780", 6 - %226 = getelementptr inbounds nuw i64, ptr %1, i64 %225 - %227 = load i64, ptr %226, align 4 - %228 = and i64 %"124_0.sroa.0.0780", 63 - %229 = lshr i64 %227, %228 - %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_129, label %panic.i749 - -panic.i749: ; preds = %__barray_check_bounds.exit748 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %221, %cond_exit_253 ] + %213 = lshr i64 %"249_2.01711", 6 + %214 = getelementptr inbounds nuw i64, ptr %5, i64 %213 + %215 = load i64, ptr %214, align 4 + %216 = and i64 %"249_2.01711", 63 + %217 = lshr i64 %215, %216 + %218 = trunc i64 %217 to i1 + br i1 %218, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit748 - %231 = uitofp nneg i64 %"124_0.sroa.0.0780" to double - %232 = fmul double %231, 6.250000e-02 - %233 = add nuw nsw i64 %"124_0.sroa.0.0780", 1 - %234 = shl nuw i64 1, %228 - %235 = xor i64 %227, %234 - store i64 %235, ptr %226, align 4 - %236 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0780" - store double %232, ptr %236, align 8 - %exitcond782.not = icmp eq i64 %233, 100 - br i1 %exitcond782.not, label %loop_out211, label %__barray_check_bounds.exit748 - -loop_out211: ; preds = %cond_exit_129 - %237 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %238 = load i64, ptr %237, align 4 - %239 = and i64 %238, 68719476735 - store i64 %239, ptr %237, align 4 - %240 = load i64, ptr %1, align 4 - %241 = icmp eq i64 %240, 0 - %242 = icmp eq i64 %239, 0 - %or.cond784 = select i1 %241, i1 %242, i1 false - br i1 %or.cond784, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i753 - -__barray_check_none_borrowed.exit755: ; preds = %loop_out211 - %243 = call ptr @heap_alloc(i64 800) - %244 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %244, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %243, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %243) - %245 = load i64, ptr %237, align 4 - %246 = and i64 %245, 68719476735 - store i64 %246, ptr %237, align 4 - %247 = load i64, ptr %1, align 4 - %248 = icmp eq i64 %247, 0 - %249 = icmp eq i64 %246, 0 - %or.cond785 = select i1 %248, i1 %249, i1 false - br i1 %or.cond785, label %__barray_check_none_borrowed.exit760, label %mask_block_err.i758 - -mask_block_err.i753: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %219 = uitofp nneg i64 %"249_2.01711" to double + %220 = fmul double %219, 6.250000e-02 + %221 = add nuw nsw i64 %"249_2.01711", 1 + %222 = shl nuw i64 1, %216 + %223 = xor i64 %215, %222 + store i64 %223, ptr %214, align 4 + %224 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %220, ptr %224, align 8 + %exitcond1714 = icmp eq i64 %221, 100 + br i1 %exitcond1714, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %225 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %226 = load i64, ptr %225, align 4 + %227 = and i64 %226, 68719476735 + store i64 %227, ptr %225, align 4 + %228 = load i64, ptr %5, align 4 + %229 = icmp eq i64 %228, 0 + %230 = icmp eq i64 %227, 0 + %or.cond1719 = select i1 %229, i1 %230, i1 false + br i1 %or.cond1719, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %231 = call ptr @heap_alloc(i64 800) + %232 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %232, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %231, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %231) + %233 = load i64, ptr %225, align 4 + %234 = and i64 %233, 68719476735 + store i64 %234, ptr %225, align 4 + %235 = load i64, ptr %5, align 4 + %236 = icmp eq i64 %235, 0 + %237 = icmp eq i64 %234, 0 + %or.cond1720 = select i1 %236, i1 %237, i1 false + br i1 %or.cond1720, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit760: ; preds = %__barray_check_none_borrowed.exit755 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %250 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %250, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %250, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %238 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %238, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %238, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i758: ; preds = %__barray_check_none_borrowed.exit755 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -759,26 +784,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-unknown-linux-gnu.ll index d2dd5a1c..ba359326 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-unknown-linux-gnu.ll @@ -3,750 +3,775 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__barray_check_bounds.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not786 = icmp eq i64 %10, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1724 = icmp eq i64 %14, 0 + br i1 %.not1724, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not787 = icmp eq i64 %14, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1725 = icmp eq i64 %18, 0 + br i1 %.not1725, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not788 = icmp eq i64 %18, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1726 = icmp eq i64 %22, 0 + br i1 %.not1726, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not789 = icmp eq i64 %22, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1727 = icmp eq i64 %26, 0 + br i1 %.not1727, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not790 = icmp eq i64 %26, 0 - br i1 %.not790, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1728 = icmp eq i64 %30, 0 + br i1 %.not1728, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not791 = icmp eq i64 %30, 0 - br i1 %.not791, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1729 = icmp eq i64 %34, 0 + br i1 %.not1729, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not792 = icmp eq i64 %34, 0 - br i1 %.not792, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1730 = icmp eq i64 %38, 0 + br i1 %.not1730, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not793 = icmp eq i64 %38, 0 - br i1 %.not793, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1731 = icmp eq i64 %42, 0 + br i1 %.not1731, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not794 = icmp eq i64 %42, 0 - br i1 %.not794, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1732 = icmp eq i64 %46, 0 + br i1 %.not1732, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %56 = load i64, ptr %55, align 4 - tail call void @___rp(i64 %56, double 0x400921FB54442D18, double 0.000000e+00) - %57 = load i64, ptr %5, align 4 - %58 = and i64 %57, 4 - %.not770 = icmp eq i64 %58, 0 - br i1 %.not770, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %60 = load i64, ptr %59, align 4 + tail call void @___rp(i64 %60, double 0x400921FB54442D18, double 0.000000e+00) + %61 = load i64, ptr %9, align 4 + %62 = and i64 %61, 4 + %.not1701 = icmp eq i64 %62, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %59 = and i64 %57, -5 - store i64 %59, ptr %5, align 4 - store i64 %56, ptr %55, align 4 - %60 = load i64, ptr %5, align 4 - %61 = and i64 %60, 8 - %.not771 = icmp eq i64 %61, 0 - br i1 %.not771, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %63 = and i64 %61, -5 + store i64 %63, ptr %9, align 4 + store i64 %60, ptr %59, align 4 + %64 = load i64, ptr %9, align 4 + %65 = and i64 %64, 8 + %.not1702 = icmp eq i64 %65, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %62 = or disjoint i64 %60, 8 - store i64 %62, ptr %5, align 4 - %63 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %64 = load i64, ptr %63, align 4 - tail call void @___rp(i64 %64, double 0x400921FB54442D18, double 0.000000e+00) - %65 = load i64, ptr %5, align 4 - %66 = and i64 %65, 8 - %.not772 = icmp eq i64 %66, 0 - br i1 %.not772, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %66 = or disjoint i64 %64, 8 + store i64 %66, ptr %9, align 4 + %67 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %68 = load i64, ptr %67, align 4 + tail call void @___rp(i64 %68, double 0x400921FB54442D18, double 0.000000e+00) + %69 = load i64, ptr %9, align 4 + %70 = and i64 %69, 8 + %.not1703 = icmp eq i64 %70, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %67 = and i64 %65, -9 - store i64 %67, ptr %5, align 4 - store i64 %64, ptr %63, align 4 - %68 = load i64, ptr %5, align 4 - %69 = and i64 %68, 512 - %.not773 = icmp eq i64 %69, 0 - br i1 %.not773, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %71 = and i64 %69, -9 + store i64 %71, ptr %9, align 4 + store i64 %68, ptr %67, align 4 + %72 = load i64, ptr %9, align 4 + %73 = and i64 %72, 512 + %.not1704 = icmp eq i64 %73, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %70 = or disjoint i64 %68, 512 - store i64 %70, ptr %5, align 4 - %71 = getelementptr inbounds nuw i8, ptr %4, i64 72 - %72 = load i64, ptr %71, align 4 - tail call void @___rp(i64 %72, double 0x400921FB54442D18, double 0.000000e+00) - %73 = load i64, ptr %5, align 4 - %74 = and i64 %73, 512 - %.not774 = icmp eq i64 %74, 0 - br i1 %.not774, label %panic.i696, label %__barray_mask_return.exit697 - -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %74 = or disjoint i64 %72, 512 + store i64 %74, ptr %9, align 4 + %75 = getelementptr inbounds nuw i8, ptr %8, i64 72 + %76 = load i64, ptr %75, align 4 + tail call void @___rp(i64 %76, double 0x400921FB54442D18, double 0.000000e+00) + %77 = load i64, ptr %9, align 4 + %78 = and i64 %77, 512 + %.not1705 = icmp eq i64 %78, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %75 = and i64 %73, -513 - store i64 %75, ptr %5, align 4 - store i64 %72, ptr %71, align 4 - %76 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %77 = tail call ptr @heap_alloc(i64 80) - %78 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %78, align 1 - br label %__barray_check_bounds.exit.i.i - -79: ; preds = %loop_body.i - %80 = lshr i64 %.fca.2.extract.i.i, 6 - %81 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %.fca.2.extract.i.i, 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %89 = lshr i64 %last_valid.i.i.i, 6 - %90 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i = sub nsw i64 %89, %80 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -97: ; preds = %mask_block_ok.i.i.i - %98 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %79, %97 - %.02.i.i.i = phi i64 [ %98, %97 ], [ 0, %79 ] - %gep.i.i.i = getelementptr i64, ptr %81, i64 %.02.i.i.i - %99 = load i64, ptr %gep.i.i.i, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %79 = and i64 %77, -513 + store i64 %79, ptr %9, align 4 + store i64 %76, ptr %75, align 4 + br label %__barray_check_bounds.exit1620 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %101, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %76, %__barray_mask_return.exit697 ], [ %116, %loop_body.i ] - %101 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %102 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %102 - %112 = load i64, ptr %111, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %78, align 4 - %114 = lshr i64 %113, %"239_0.sroa.15.0178.i" - %115 = trunc i64 %114 to i1 - br i1 %115, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1616: ; preds = %.thread + %80 = load i64, ptr %3, align 4 + %81 = lshr i64 %80, %"363_2.01721" + %82 = trunc i64 %81 to i1 + br i1 %82, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %116 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %101, 1 - %117 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %118 = xor i64 %113, %117 - store i64 %118, ptr %78, align 4 - %119 = getelementptr inbounds nuw i64, ptr %77, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %119, align 4 - %120 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %120, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %120, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %120, 2 - %exitcond.not.i = icmp eq i64 %101, 10 - br i1 %exitcond.not.i, label %79, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %97, %79 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %77, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %78, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %121 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %122 = tail call ptr @heap_alloc(i64 10) - %123 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %123, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %181, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %125, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %121, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %177, %loop_body.i701 ] - %125 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i714, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i714: ; preds = %__barray_check_bounds.exit.i.i698 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_ok.i: ; preds = %cond_exit_367 + %83 = load i64, ptr %9, align 4 + %84 = or i64 %83, -1024 + store i64 %84, ptr %9, align 4 + %85 = icmp eq i64 %84, -1 + br i1 %85, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01722" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %86, %cond_exit_367 ] + %"363_2.01721" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %94, %cond_exit_367 ] + %86 = add nuw nsw i64 %"363_0.sroa.15.01722", 1 + %87 = load i64, ptr %9, align 4 + %88 = lshr i64 %87, %"363_0.sroa.15.01722" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1621, label %.thread -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_548_case_0.i.i: ; preds = %cond_exit_548.thread.i.i - %140 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %141 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %140 - %142 = load i64, ptr %141, align 4 - %143 = and i64 %"545_1.sroa.10.0.i.i", 63 - %144 = sub nuw nsw i64 64, %143 - %145 = lshr i64 -1, %144 - %146 = icmp eq i64 %143, 0 - %147 = select i1 %146, i64 0, i64 %145 - %148 = or i64 %142, %147 - store i64 %148, ptr %141, align 4 - %last_valid.i.i.i703 = add i64 %"545_1.sroa.10.0.i.i", 9 - %149 = lshr i64 %last_valid.i.i.i703, 6 - %150 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %last_valid.i.i.i703, 63 - %153 = shl nsw i64 -2, %152 - %154 = icmp eq i64 %152, 63 - %155 = select i1 %154, i64 0, i64 %153 - %156 = or i64 %151, %155 - store i64 %156, ptr %150, align 4 - %reass.sub.i.i.i704 = sub nsw i64 %149, %140 - %.not.i.i.i705 = icmp eq i64 %reass.sub.i.i.i704, -1 - br i1 %.not.i.i.i705, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -157: ; preds = %mask_block_ok.i.i.i706 - %158 = add nuw i64 %.02.i.i.i707, 1 - %exitcond.not.i.i.i710 = icmp eq i64 %.02.i.i.i707, %reass.sub.i.i.i704 - br i1 %exitcond.not.i.i.i710, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -mask_block_ok.i.i.i706: ; preds = %cond_548_case_0.i.i, %157 - %.02.i.i.i707 = phi i64 [ %158, %157 ], [ 0, %cond_548_case_0.i.i ] - %gep.i.i.i708 = getelementptr i64, ptr %141, i64 %.02.i.i.i707 - %159 = load i64, ptr %gep.i.i.i708, align 4 - %160 = icmp eq i64 %159, -1 - br i1 %160, label %157, label %mask_block_err.i.i.i709 - -mask_block_err.i.i.i709: ; preds = %mask_block_ok.i.i.i706 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +.thread: ; preds = %__barray_check_bounds.exit1620 + %90 = shl nuw nsw i64 1, %"363_0.sroa.15.01722" + %91 = xor i64 %87, %90 + store i64 %91, ptr %9, align 4 + %92 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01722" + %93 = load i64, ptr %92, align 4 + %94 = add i64 %"363_2.01721", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %93) + tail call void @___qfree(i64 %93) + %95 = icmp ult i64 %"363_2.01721", 10 + br i1 %95, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %96 = shl nuw nsw i64 1, %"363_2.01721" + %97 = xor i64 %80, %96 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01721" + store i64 %lazy_measure, ptr %98, align 4 + %99 = icmp samesign ugt i64 %"363_0.sroa.15.01722", 8 + br i1 %99, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %100, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %100 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %101 = load i64, ptr %3, align 4 + %102 = lshr i64 %101, %"429_0.sroa.15.01708" + %103 = trunc i64 %102 to i1 + br i1 %103, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_548.thread.i.i, %loop_body.preheader.i.i - %"545_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %161, %cond_exit_548.thread.i.i ] - %161 = add nuw nsw i64 %"545_0.0239.i.i", 1 - %162 = add i64 %"545_0.0239.i.i", %"545_1.sroa.10.0.i.i" - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %169, %165 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %161, 10 - br i1 %exitcond.i.i, label %cond_548_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %173 = xor i64 %137, %133 - store i64 %173, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - %174 = load i64, ptr %123, align 4 - %175 = lshr i64 %174, %"280_0.sroa.15.0168.i" - %176 = trunc i64 %175 to i1 - br i1 %176, label %loop_body.i701, label %panic.i.i700 +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %104 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %105 = xor i64 %101, %104 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %107 = load i64, ptr %106, align 4 + tail call void @___inc_future_refcount(i64 %107) + %108 = load i64, ptr %3, align 4 + %109 = lshr i64 %108, %"429_0.sroa.15.01708" + %110 = trunc i64 %109 to i1 + br i1 %110, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %111 = xor i64 %108, %104 + store i64 %111, ptr %3, align 4 + store i64 %107, ptr %106, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %107) + tail call void @___dec_future_refcount(i64 %107) + %112 = load i64, ptr %1, align 4 + %113 = lshr i64 %112, %"429_0.sroa.15.01708" + %114 = trunc i64 %113 to i1 + br i1 %114, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %177 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %178 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %179 = xor i64 %174, %178 - store i64 %179, ptr %123, align 4 - %180 = getelementptr inbounds nuw i1, ptr %122, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %180, align 1 - %181 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %157, %cond_548_case_0.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %182 = load i64, ptr %123, align 4 - %183 = and i64 %182, 1023 - store i64 %183, ptr %123, align 4 - %184 = icmp eq i64 %183, 0 - br i1 %184, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %185 = tail call ptr @heap_alloc(i64 10) - %186 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %186, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %185, ptr noundef nonnull align 1 dereferenceable(10) %122, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %185) - %187 = load i64, ptr %123, align 4 - %188 = and i64 %187, 1023 - store i64 %188, ptr %123, align 4 - %189 = icmp eq i64 %188, 0 - br i1 %189, label %__barray_check_none_borrowed.exit720, label %mask_block_err.i718 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %115 = or disjoint i64 %168, 1 + store i64 %115, ptr %3, align 4 + %116 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 2 + %.not1733 = icmp eq i64 %118, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %119 = or disjoint i64 %117, 2 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 4 + %.not1734 = icmp eq i64 %123, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %124 = or disjoint i64 %122, 4 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 8 + %.not1735 = icmp eq i64 %128, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %129 = or disjoint i64 %127, 8 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 16 + %.not1736 = icmp eq i64 %133, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %134 = or disjoint i64 %132, 16 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 32 + %.not1737 = icmp eq i64 %138, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %139 = or disjoint i64 %137, 32 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 64 + %.not1738 = icmp eq i64 %143, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %144 = or disjoint i64 %142, 64 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 128 + %.not1739 = icmp eq i64 %148, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %149 = or disjoint i64 %147, 128 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 256 + %.not1740 = icmp eq i64 %153, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %154 = or disjoint i64 %152, 256 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %157 = load i64, ptr %3, align 4 + %158 = and i64 %157, 512 + %.not1741 = icmp eq i64 %158, 0 + br i1 %.not1741, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %159 = or disjoint i64 %157, 512 + store i64 %159, ptr %3, align 4 + %160 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %162 = load i64, ptr %3, align 4 + %163 = or i64 %162, -1024 + store i64 %163, ptr %3, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %165 = xor i64 %112, %104 + store i64 %165, ptr %1, align 4 + %166 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %166, align 1 + %167 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %167, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %168 = load i64, ptr %3, align 4 + %169 = trunc i64 %168 to i1 + br i1 %169, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %173 = tail call ptr @heap_alloc(i64 10) + %174 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %174, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %173) + %175 = load i64, ptr %1, align 4 + %176 = and i64 %175, 1023 + store i64 %176, ptr %1, align 4 + %177 = icmp eq i64 %176, 0 + br i1 %177, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit720: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %190 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %190, i8 0, i64 10, i1 false) + %178 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %178, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %122, ptr %arr_ptr, align 8 - store ptr %190, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %178, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit728 + br label %__barray_check_bounds.exit1657 -mask_block_err.i718: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit728: ; preds = %cond_exit_94.1, %__barray_check_none_borrowed.exit720 - %"89_0.sroa.0.0778" = phi i64 [ 0, %__barray_check_none_borrowed.exit720 ], [ %207, %cond_exit_94.1 ] - %191 = lshr i64 %"89_0.sroa.0.0778", 6 - %192 = getelementptr inbounds nuw i64, ptr %3, i64 %191 - %193 = load i64, ptr %192, align 4 - %194 = and i64 %"89_0.sroa.0.0778", 62 - %195 = lshr i64 %193, %194 - %196 = trunc i64 %195 to i1 - br i1 %196, label %cond_exit_94, label %panic.i729 - -panic.i729: ; preds = %cond_exit_94, %__barray_check_bounds.exit728 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147.1, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %195, %cond_exit_147.1 ] + %179 = lshr i64 %"143_2.01709", 6 + %180 = getelementptr inbounds nuw i64, ptr %7, i64 %179 + %181 = load i64, ptr %180, align 4 + %182 = and i64 %"143_2.01709", 62 + %183 = lshr i64 %181, %182 + %184 = trunc i64 %183 to i1 + br i1 %184, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %cond_exit_147, %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit728 - %197 = or disjoint i64 %"89_0.sroa.0.0778", 1 - %198 = shl nuw nsw i64 1, %194 - %199 = xor i64 %193, %198 - store i64 %199, ptr %192, align 4 - %200 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0778" - store i64 %"89_0.sroa.0.0778", ptr %200, align 4 - %201 = lshr i64 %"89_0.sroa.0.0778", 6 - %202 = getelementptr inbounds nuw i64, ptr %3, i64 %201 - %203 = load i64, ptr %202, align 4 - %204 = and i64 %197, 63 - %205 = lshr i64 %203, %204 - %206 = trunc i64 %205 to i1 - br i1 %206, label %cond_exit_94.1, label %panic.i729 - -cond_exit_94.1: ; preds = %cond_exit_94 - %207 = add nuw nsw i64 %"89_0.sroa.0.0778", 2 - %208 = shl nuw i64 1, %204 - %209 = xor i64 %203, %208 - store i64 %209, ptr %202, align 4 - %210 = getelementptr inbounds nuw i64, ptr %2, i64 %197 - store i64 %197, ptr %210, align 4 - %exitcond781.not.1 = icmp eq i64 %207, 100 - br i1 %exitcond781.not.1, label %loop_out127, label %__barray_check_bounds.exit728 - -loop_out127: ; preds = %cond_exit_94.1 - %211 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %212 = load i64, ptr %211, align 4 - %213 = and i64 %212, 68719476735 - store i64 %213, ptr %211, align 4 - %214 = load i64, ptr %3, align 4 - %215 = icmp eq i64 %214, 0 - %216 = icmp eq i64 %213, 0 - %or.cond = select i1 %215, i1 %216, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit735, label %mask_block_err.i733 - -__barray_check_none_borrowed.exit735: ; preds = %loop_out127 - %217 = call ptr @heap_alloc(i64 800) - %218 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %218, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %217, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %217) - %219 = load i64, ptr %211, align 4 - %220 = and i64 %219, 68719476735 - store i64 %220, ptr %211, align 4 - %221 = load i64, ptr %3, align 4 - %222 = icmp eq i64 %221, 0 - %223 = icmp eq i64 %220, 0 - %or.cond783 = select i1 %222, i1 %223, i1 false - br i1 %or.cond783, label %__barray_check_none_borrowed.exit740, label %mask_block_err.i738 - -mask_block_err.i733: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %185 = or disjoint i64 %"143_2.01709", 1 + %186 = shl nuw nsw i64 1, %182 + %187 = xor i64 %181, %186 + store i64 %187, ptr %180, align 4 + %188 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %188, align 4 + %189 = lshr i64 %"143_2.01709", 6 + %190 = getelementptr inbounds nuw i64, ptr %7, i64 %189 + %191 = load i64, ptr %190, align 4 + %192 = and i64 %185, 63 + %193 = lshr i64 %191, %192 + %194 = trunc i64 %193 to i1 + br i1 %194, label %cond_exit_147.1, label %panic.i1658 + +cond_exit_147.1: ; preds = %cond_exit_147 + %195 = add nuw nsw i64 %"143_2.01709", 2 + %196 = shl nuw i64 1, %192 + %197 = xor i64 %191, %196 + store i64 %197, ptr %190, align 4 + %198 = getelementptr inbounds nuw i64, ptr %6, i64 %185 + store i64 %185, ptr %198, align 4 + %exitcond1713.1 = icmp eq i64 %195, 100 + br i1 %exitcond1713.1, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147.1 + %199 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %200 = load i64, ptr %199, align 4 + %201 = and i64 %200, 68719476735 + store i64 %201, ptr %199, align 4 + %202 = load i64, ptr %7, align 4 + %203 = icmp eq i64 %202, 0 + %204 = icmp eq i64 %201, 0 + %or.cond = select i1 %203, i1 %204, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %205 = call ptr @heap_alloc(i64 800) + %206 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %206, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %205, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %205) + %207 = load i64, ptr %199, align 4 + %208 = and i64 %207, 68719476735 + store i64 %208, ptr %199, align 4 + %209 = load i64, ptr %7, align 4 + %210 = icmp eq i64 %209, 0 + %211 = icmp eq i64 %208, 0 + %or.cond1718 = select i1 %210, i1 %211, i1 false + br i1 %or.cond1718, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit740: ; preds = %__barray_check_none_borrowed.exit735 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %224 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %224, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %224, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit748 - -mask_block_err.i738: ; preds = %__barray_check_none_borrowed.exit735 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %212 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %212, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %212, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit748: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit740 - %"124_0.sroa.0.0780" = phi i64 [ 0, %__barray_check_none_borrowed.exit740 ], [ %233, %cond_exit_129 ] - %225 = lshr i64 %"124_0.sroa.0.0780", 6 - %226 = getelementptr inbounds nuw i64, ptr %1, i64 %225 - %227 = load i64, ptr %226, align 4 - %228 = and i64 %"124_0.sroa.0.0780", 63 - %229 = lshr i64 %227, %228 - %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_129, label %panic.i749 - -panic.i749: ; preds = %__barray_check_bounds.exit748 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %221, %cond_exit_253 ] + %213 = lshr i64 %"249_2.01711", 6 + %214 = getelementptr inbounds nuw i64, ptr %5, i64 %213 + %215 = load i64, ptr %214, align 4 + %216 = and i64 %"249_2.01711", 63 + %217 = lshr i64 %215, %216 + %218 = trunc i64 %217 to i1 + br i1 %218, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit748 - %231 = uitofp nneg i64 %"124_0.sroa.0.0780" to double - %232 = fmul double %231, 6.250000e-02 - %233 = add nuw nsw i64 %"124_0.sroa.0.0780", 1 - %234 = shl nuw i64 1, %228 - %235 = xor i64 %227, %234 - store i64 %235, ptr %226, align 4 - %236 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0780" - store double %232, ptr %236, align 8 - %exitcond782.not = icmp eq i64 %233, 100 - br i1 %exitcond782.not, label %loop_out211, label %__barray_check_bounds.exit748 - -loop_out211: ; preds = %cond_exit_129 - %237 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %238 = load i64, ptr %237, align 4 - %239 = and i64 %238, 68719476735 - store i64 %239, ptr %237, align 4 - %240 = load i64, ptr %1, align 4 - %241 = icmp eq i64 %240, 0 - %242 = icmp eq i64 %239, 0 - %or.cond784 = select i1 %241, i1 %242, i1 false - br i1 %or.cond784, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i753 - -__barray_check_none_borrowed.exit755: ; preds = %loop_out211 - %243 = call ptr @heap_alloc(i64 800) - %244 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %244, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %243, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %243) - %245 = load i64, ptr %237, align 4 - %246 = and i64 %245, 68719476735 - store i64 %246, ptr %237, align 4 - %247 = load i64, ptr %1, align 4 - %248 = icmp eq i64 %247, 0 - %249 = icmp eq i64 %246, 0 - %or.cond785 = select i1 %248, i1 %249, i1 false - br i1 %or.cond785, label %__barray_check_none_borrowed.exit760, label %mask_block_err.i758 - -mask_block_err.i753: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %219 = uitofp nneg i64 %"249_2.01711" to double + %220 = fmul double %219, 6.250000e-02 + %221 = add nuw nsw i64 %"249_2.01711", 1 + %222 = shl nuw i64 1, %216 + %223 = xor i64 %215, %222 + store i64 %223, ptr %214, align 4 + %224 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %220, ptr %224, align 8 + %exitcond1714 = icmp eq i64 %221, 100 + br i1 %exitcond1714, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %225 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %226 = load i64, ptr %225, align 4 + %227 = and i64 %226, 68719476735 + store i64 %227, ptr %225, align 4 + %228 = load i64, ptr %5, align 4 + %229 = icmp eq i64 %228, 0 + %230 = icmp eq i64 %227, 0 + %or.cond1719 = select i1 %229, i1 %230, i1 false + br i1 %or.cond1719, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %231 = call ptr @heap_alloc(i64 800) + %232 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %232, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %231, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %231) + %233 = load i64, ptr %225, align 4 + %234 = and i64 %233, 68719476735 + store i64 %234, ptr %225, align 4 + %235 = load i64, ptr %5, align 4 + %236 = icmp eq i64 %235, 0 + %237 = icmp eq i64 %234, 0 + %or.cond1720 = select i1 %236, i1 %237, i1 false + br i1 %or.cond1720, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit760: ; preds = %__barray_check_none_borrowed.exit755 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %250 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %250, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %250, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %238 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %238, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %238, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i758: ; preds = %__barray_check_none_borrowed.exit755 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -759,26 +784,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-windows-gnu.ll index d6528d67..fd30fe24 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_print_array/flip_n4_arr-sol-x86_64-windows-gnu.ll @@ -3,750 +3,775 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" @res_is.F21393DB.0 = private constant [15 x i8] c"\0EUSER:INTARR:is" @res_fs.CBD4AF54.0 = private constant [17 x i8] c"\10USER:FLOATARR:fs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 800) - %1 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - %2 = tail call ptr @heap_alloc(i64 800) - %3 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) - %4 = tail call ptr @heap_alloc(i64 80) - %5 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %5, align 1 + %0 = tail call ptr @heap_alloc(i64 10) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 800) + %7 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %7, i8 -1, i64 16, i1 false) + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_525_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_557_case_0.i, label %__barray_check_bounds.exit -cond_525_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_557_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %6 = load i64, ptr %5, align 4 - %7 = trunc i64 %6 to i1 - br i1 %7, label %cond_exit_20, label %panic.i + %10 = load i64, ptr %9, align 4 + %11 = trunc i64 %10 to i1 + br i1 %11, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %8 = and i64 %6, -2 - store i64 %8, ptr %5, align 4 - store i64 %qalloc.i, ptr %4, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %12 = and i64 %10, -2 + store i64 %12, ptr %9, align 4 + store i64 %qalloc.i, ptr %8, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_525_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_557_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %9 = load i64, ptr %5, align 4 - %10 = and i64 %9, 2 - %.not786 = icmp eq i64 %10, 0 - br i1 %.not786, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %11 = and i64 %9, -3 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 - store i64 %qalloc.i.1, ptr %12, align 4 + %13 = load i64, ptr %9, align 4 + %14 = and i64 %13, 2 + %.not1724 = icmp eq i64 %14, 0 + br i1 %.not1724, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %15 = and i64 %13, -3 + store i64 %15, ptr %9, align 4 + %16 = getelementptr inbounds nuw i8, ptr %8, i64 8 + store i64 %qalloc.i.1, ptr %16, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_525_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_557_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %13 = load i64, ptr %5, align 4 - %14 = and i64 %13, 4 - %.not787 = icmp eq i64 %14, 0 - br i1 %.not787, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %15 = and i64 %13, -5 - store i64 %15, ptr %5, align 4 - %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 - store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %9, align 4 + %18 = and i64 %17, 4 + %.not1725 = icmp eq i64 %18, 0 + br i1 %.not1725, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %19 = and i64 %17, -5 + store i64 %19, ptr %9, align 4 + %20 = getelementptr inbounds nuw i8, ptr %8, i64 16 + store i64 %qalloc.i.2, ptr %20, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_525_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_557_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %17 = load i64, ptr %5, align 4 - %18 = and i64 %17, 8 - %.not788 = icmp eq i64 %18, 0 - br i1 %.not788, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %19 = and i64 %17, -9 - store i64 %19, ptr %5, align 4 - %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 - store i64 %qalloc.i.3, ptr %20, align 4 + %21 = load i64, ptr %9, align 4 + %22 = and i64 %21, 8 + %.not1726 = icmp eq i64 %22, 0 + br i1 %.not1726, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %23 = and i64 %21, -9 + store i64 %23, ptr %9, align 4 + %24 = getelementptr inbounds nuw i8, ptr %8, i64 24 + store i64 %qalloc.i.3, ptr %24, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_525_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_557_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %21 = load i64, ptr %5, align 4 - %22 = and i64 %21, 16 - %.not789 = icmp eq i64 %22, 0 - br i1 %.not789, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %23 = and i64 %21, -17 - store i64 %23, ptr %5, align 4 - %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 - store i64 %qalloc.i.4, ptr %24, align 4 + %25 = load i64, ptr %9, align 4 + %26 = and i64 %25, 16 + %.not1727 = icmp eq i64 %26, 0 + br i1 %.not1727, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %27 = and i64 %25, -17 + store i64 %27, ptr %9, align 4 + %28 = getelementptr inbounds nuw i8, ptr %8, i64 32 + store i64 %qalloc.i.4, ptr %28, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_525_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_557_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %25 = load i64, ptr %5, align 4 - %26 = and i64 %25, 32 - %.not790 = icmp eq i64 %26, 0 - br i1 %.not790, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %27 = and i64 %25, -33 - store i64 %27, ptr %5, align 4 - %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 - store i64 %qalloc.i.5, ptr %28, align 4 + %29 = load i64, ptr %9, align 4 + %30 = and i64 %29, 32 + %.not1728 = icmp eq i64 %30, 0 + br i1 %.not1728, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %31 = and i64 %29, -33 + store i64 %31, ptr %9, align 4 + %32 = getelementptr inbounds nuw i8, ptr %8, i64 40 + store i64 %qalloc.i.5, ptr %32, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_525_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_557_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %29 = load i64, ptr %5, align 4 - %30 = and i64 %29, 64 - %.not791 = icmp eq i64 %30, 0 - br i1 %.not791, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %31 = and i64 %29, -65 - store i64 %31, ptr %5, align 4 - %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 - store i64 %qalloc.i.6, ptr %32, align 4 + %33 = load i64, ptr %9, align 4 + %34 = and i64 %33, 64 + %.not1729 = icmp eq i64 %34, 0 + br i1 %.not1729, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %35 = and i64 %33, -65 + store i64 %35, ptr %9, align 4 + %36 = getelementptr inbounds nuw i8, ptr %8, i64 48 + store i64 %qalloc.i.6, ptr %36, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_525_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_557_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %33 = load i64, ptr %5, align 4 - %34 = and i64 %33, 128 - %.not792 = icmp eq i64 %34, 0 - br i1 %.not792, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %35 = and i64 %33, -129 - store i64 %35, ptr %5, align 4 - %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 - store i64 %qalloc.i.7, ptr %36, align 4 + %37 = load i64, ptr %9, align 4 + %38 = and i64 %37, 128 + %.not1730 = icmp eq i64 %38, 0 + br i1 %.not1730, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %39 = and i64 %37, -129 + store i64 %39, ptr %9, align 4 + %40 = getelementptr inbounds nuw i8, ptr %8, i64 56 + store i64 %qalloc.i.7, ptr %40, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_525_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_557_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %37 = load i64, ptr %5, align 4 - %38 = and i64 %37, 256 - %.not793 = icmp eq i64 %38, 0 - br i1 %.not793, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %39 = and i64 %37, -257 - store i64 %39, ptr %5, align 4 - %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 - store i64 %qalloc.i.8, ptr %40, align 4 + %41 = load i64, ptr %9, align 4 + %42 = and i64 %41, 256 + %.not1731 = icmp eq i64 %42, 0 + br i1 %.not1731, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %43 = and i64 %41, -257 + store i64 %43, ptr %9, align 4 + %44 = getelementptr inbounds nuw i8, ptr %8, i64 64 + store i64 %qalloc.i.8, ptr %44, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_525_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_557_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %41 = load i64, ptr %5, align 4 - %42 = and i64 %41, 512 - %.not794 = icmp eq i64 %42, 0 - br i1 %.not794, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %43 = and i64 %41, -513 - store i64 %43, ptr %5, align 4 - %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 - store i64 %qalloc.i.9, ptr %44, align 4 - %"120.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %4, 0 - %"120.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.0.insert", ptr %5, 1 - %"120.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"120.fca.1.insert", i64 0, 2 - %45 = load i64, ptr %5, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i683, label %__barray_mask_borrow.exit - -panic.i683: ; preds = %cond_exit_20.9 + %45 = load i64, ptr %9, align 4 + %46 = and i64 %45, 512 + %.not1732 = icmp eq i64 %46, 0 + br i1 %.not1732, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %47 = and i64 %45, -513 + store i64 %47, ptr %9, align 4 + %48 = getelementptr inbounds nuw i8, ptr %8, i64 72 + store i64 %qalloc.i.9, ptr %48, align 4 + %49 = load i64, ptr %9, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %panic.i1600, label %__barray_mask_borrow.exit + +panic.i1600: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %47 = or disjoint i64 %45, 1 - store i64 %47, ptr %5, align 4 - %48 = load i64, ptr %4, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %5, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %__barray_mask_return.exit685, label %panic.i684 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %51 = or disjoint i64 %49, 1 + store i64 %51, ptr %9, align 4 + %52 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) + %53 = load i64, ptr %9, align 4 + %54 = trunc i64 %53 to i1 + br i1 %54, label %__barray_mask_return.exit1602, label %panic.i1601 -panic.i684: ; preds = %__barray_mask_borrow.exit +panic.i1601: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit685: ; preds = %__barray_mask_borrow.exit - %51 = and i64 %49, -2 - store i64 %51, ptr %5, align 4 - store i64 %48, ptr %4, align 4 - %52 = load i64, ptr %5, align 4 - %53 = and i64 %52, 4 - %.not = icmp eq i64 %53, 0 - br i1 %.not, label %__barray_mask_borrow.exit687, label %panic.i686 +__barray_mask_return.exit1602: ; preds = %__barray_mask_borrow.exit + %55 = and i64 %53, -2 + store i64 %55, ptr %9, align 4 + store i64 %52, ptr %8, align 4 + %56 = load i64, ptr %9, align 4 + %57 = and i64 %56, 4 + %.not = icmp eq i64 %57, 0 + br i1 %.not, label %__barray_mask_borrow.exit1604, label %panic.i1603 -panic.i686: ; preds = %__barray_mask_return.exit685 +panic.i1603: ; preds = %__barray_mask_return.exit1602 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit687: ; preds = %__barray_mask_return.exit685 - %54 = or disjoint i64 %52, 4 - store i64 %54, ptr %5, align 4 - %55 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %56 = load i64, ptr %55, align 4 - tail call void @___rp(i64 %56, double 0x400921FB54442D18, double 0.000000e+00) - %57 = load i64, ptr %5, align 4 - %58 = and i64 %57, 4 - %.not770 = icmp eq i64 %58, 0 - br i1 %.not770, label %panic.i688, label %__barray_mask_return.exit689 - -panic.i688: ; preds = %__barray_mask_borrow.exit687 +__barray_mask_borrow.exit1604: ; preds = %__barray_mask_return.exit1602 + %58 = or disjoint i64 %56, 4 + store i64 %58, ptr %9, align 4 + %59 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %60 = load i64, ptr %59, align 4 + tail call void @___rp(i64 %60, double 0x400921FB54442D18, double 0.000000e+00) + %61 = load i64, ptr %9, align 4 + %62 = and i64 %61, 4 + %.not1701 = icmp eq i64 %62, 0 + br i1 %.not1701, label %panic.i1605, label %__barray_mask_return.exit1606 + +panic.i1605: ; preds = %__barray_mask_borrow.exit1604 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit689: ; preds = %__barray_mask_borrow.exit687 - %59 = and i64 %57, -5 - store i64 %59, ptr %5, align 4 - store i64 %56, ptr %55, align 4 - %60 = load i64, ptr %5, align 4 - %61 = and i64 %60, 8 - %.not771 = icmp eq i64 %61, 0 - br i1 %.not771, label %__barray_mask_borrow.exit691, label %panic.i690 +__barray_mask_return.exit1606: ; preds = %__barray_mask_borrow.exit1604 + %63 = and i64 %61, -5 + store i64 %63, ptr %9, align 4 + store i64 %60, ptr %59, align 4 + %64 = load i64, ptr %9, align 4 + %65 = and i64 %64, 8 + %.not1702 = icmp eq i64 %65, 0 + br i1 %.not1702, label %__barray_mask_borrow.exit1608, label %panic.i1607 -panic.i690: ; preds = %__barray_mask_return.exit689 +panic.i1607: ; preds = %__barray_mask_return.exit1606 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit691: ; preds = %__barray_mask_return.exit689 - %62 = or disjoint i64 %60, 8 - store i64 %62, ptr %5, align 4 - %63 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %64 = load i64, ptr %63, align 4 - tail call void @___rp(i64 %64, double 0x400921FB54442D18, double 0.000000e+00) - %65 = load i64, ptr %5, align 4 - %66 = and i64 %65, 8 - %.not772 = icmp eq i64 %66, 0 - br i1 %.not772, label %panic.i692, label %__barray_mask_return.exit693 - -panic.i692: ; preds = %__barray_mask_borrow.exit691 +__barray_mask_borrow.exit1608: ; preds = %__barray_mask_return.exit1606 + %66 = or disjoint i64 %64, 8 + store i64 %66, ptr %9, align 4 + %67 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %68 = load i64, ptr %67, align 4 + tail call void @___rp(i64 %68, double 0x400921FB54442D18, double 0.000000e+00) + %69 = load i64, ptr %9, align 4 + %70 = and i64 %69, 8 + %.not1703 = icmp eq i64 %70, 0 + br i1 %.not1703, label %panic.i1609, label %__barray_mask_return.exit1610 + +panic.i1609: ; preds = %__barray_mask_borrow.exit1608 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit693: ; preds = %__barray_mask_borrow.exit691 - %67 = and i64 %65, -9 - store i64 %67, ptr %5, align 4 - store i64 %64, ptr %63, align 4 - %68 = load i64, ptr %5, align 4 - %69 = and i64 %68, 512 - %.not773 = icmp eq i64 %69, 0 - br i1 %.not773, label %__barray_mask_borrow.exit695, label %panic.i694 +__barray_mask_return.exit1610: ; preds = %__barray_mask_borrow.exit1608 + %71 = and i64 %69, -9 + store i64 %71, ptr %9, align 4 + store i64 %68, ptr %67, align 4 + %72 = load i64, ptr %9, align 4 + %73 = and i64 %72, 512 + %.not1704 = icmp eq i64 %73, 0 + br i1 %.not1704, label %__barray_mask_borrow.exit1612, label %panic.i1611 -panic.i694: ; preds = %__barray_mask_return.exit693 +panic.i1611: ; preds = %__barray_mask_return.exit1610 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit695: ; preds = %__barray_mask_return.exit693 - %70 = or disjoint i64 %68, 512 - store i64 %70, ptr %5, align 4 - %71 = getelementptr inbounds nuw i8, ptr %4, i64 72 - %72 = load i64, ptr %71, align 4 - tail call void @___rp(i64 %72, double 0x400921FB54442D18, double 0.000000e+00) - %73 = load i64, ptr %5, align 4 - %74 = and i64 %73, 512 - %.not774 = icmp eq i64 %74, 0 - br i1 %.not774, label %panic.i696, label %__barray_mask_return.exit697 - -panic.i696: ; preds = %__barray_mask_borrow.exit695 +__barray_mask_borrow.exit1612: ; preds = %__barray_mask_return.exit1610 + %74 = or disjoint i64 %72, 512 + store i64 %74, ptr %9, align 4 + %75 = getelementptr inbounds nuw i8, ptr %8, i64 72 + %76 = load i64, ptr %75, align 4 + tail call void @___rp(i64 %76, double 0x400921FB54442D18, double 0.000000e+00) + %77 = load i64, ptr %9, align 4 + %78 = and i64 %77, 512 + %.not1705 = icmp eq i64 %78, 0 + br i1 %.not1705, label %panic.i1613, label %__barray_mask_return.exit1614 + +panic.i1613: ; preds = %__barray_mask_borrow.exit1612 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit697: ; preds = %__barray_mask_borrow.exit695 - %75 = and i64 %73, -513 - store i64 %75, ptr %5, align 4 - store i64 %72, ptr %71, align 4 - %76 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"120.fca.2.insert", 0 - %77 = tail call ptr @heap_alloc(i64 80) - %78 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %78, align 1 - br label %__barray_check_bounds.exit.i.i - -79: ; preds = %loop_body.i - %80 = lshr i64 %.fca.2.extract.i.i, 6 - %81 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %.fca.2.extract.i.i, 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %89 = lshr i64 %last_valid.i.i.i, 6 - %90 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i = sub nsw i64 %89, %80 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -97: ; preds = %mask_block_ok.i.i.i - %98 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %79, %97 - %.02.i.i.i = phi i64 [ %98, %97 ], [ 0, %79 ] - %gep.i.i.i = getelementptr i64, ptr %81, i64 %.02.i.i.i - %99 = load i64, ptr %gep.i.i.i, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1614: ; preds = %__barray_mask_borrow.exit1612 + %79 = and i64 %77, -513 + store i64 %79, ptr %9, align 4 + store i64 %76, ptr %75, align 4 + br label %__barray_check_bounds.exit1620 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %__barray_mask_return.exit697 - %.fca.2.extract.i181.i = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %5, %__barray_mask_return.exit697 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %4, %__barray_mask_return.exit697 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"239_0.sroa.15.0178.i" = phi i64 [ 0, %__barray_mask_return.exit697 ], [ %101, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %76, %__barray_mask_return.exit697 ], [ %116, %loop_body.i ] - %101 = add nuw nsw i64 %"239_0.sroa.15.0178.i", 1 - %102 = add i64 %"239_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1615: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %102 - %112 = load i64, ptr %111, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %112) - tail call void @___qfree(i64 %112) - %113 = load i64, ptr %78, align 4 - %114 = lshr i64 %113, %"239_0.sroa.15.0178.i" - %115 = trunc i64 %114 to i1 - br i1 %115, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1616: ; preds = %.thread + %80 = load i64, ptr %3, align 4 + %81 = lshr i64 %80, %"363_2.01721" + %82 = trunc i64 %81 to i1 + br i1 %82, label %cond_exit_367, label %panic.i1617 + +panic.i1617: ; preds = %__barray_check_bounds.exit1616 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %116 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %101, 1 - %117 = shl nuw nsw i64 1, %"239_0.sroa.15.0178.i" - %118 = xor i64 %113, %117 - store i64 %118, ptr %78, align 4 - %119 = getelementptr inbounds nuw i64, ptr %77, i64 %"239_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %119, align 4 - %120 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %120, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %120, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %120, 2 - %exitcond.not.i = icmp eq i64 %101, 10 - br i1 %exitcond.not.i, label %79, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.225.exit": ; preds = %97, %79 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %77, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %78, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %121 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %122 = tail call ptr @heap_alloc(i64 10) - %123 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %123, align 1 - br label %__barray_check_bounds.exit.i.i698 - -loop_body.preheader.i.i: ; preds = %loop_body.i701 - %"545_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 2 - %"545_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 1 - %"545_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %181, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i698: ; preds = %loop_body.i701, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %181, %loop_body.i701 ] - %"280_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %125, %loop_body.i701 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %121, %"__hugr__.guppylang.std.quantum.measure_array$10.225.exit" ], [ %177, %loop_body.i701 ] - %125 = add nuw nsw i64 %"280_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"280_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i714, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i714: ; preds = %__barray_check_bounds.exit.i.i698 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_ok.i: ; preds = %cond_exit_367 + %83 = load i64, ptr %9, align 4 + %84 = or i64 %83, -1024 + store i64 %84, ptr %9, align 4 + %85 = icmp eq i64 %84, -1 + br i1 %85, label %loop_body311.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i698 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i699, label %panic.i222.i.i +__barray_check_bounds.exit1620: ; preds = %__barray_mask_return.exit1614, %cond_exit_367 + %"363_0.sroa.15.01722" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %86, %cond_exit_367 ] + %"363_2.01721" = phi i64 [ 0, %__barray_mask_return.exit1614 ], [ %94, %cond_exit_367 ] + %86 = add nuw nsw i64 %"363_0.sroa.15.01722", 1 + %87 = load i64, ptr %9, align 4 + %88 = lshr i64 %87, %"363_0.sroa.15.01722" + %89 = trunc i64 %88 to i1 + br i1 %89, label %panic.i1621, label %.thread -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i1621: ; preds = %__barray_check_bounds.exit1620 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_548_case_0.i.i: ; preds = %cond_exit_548.thread.i.i - %140 = lshr i64 %"545_1.sroa.10.0.i.i", 6 - %141 = getelementptr i64, ptr %"545_1.sroa.5.0.i.i", i64 %140 - %142 = load i64, ptr %141, align 4 - %143 = and i64 %"545_1.sroa.10.0.i.i", 63 - %144 = sub nuw nsw i64 64, %143 - %145 = lshr i64 -1, %144 - %146 = icmp eq i64 %143, 0 - %147 = select i1 %146, i64 0, i64 %145 - %148 = or i64 %142, %147 - store i64 %148, ptr %141, align 4 - %last_valid.i.i.i703 = add i64 %"545_1.sroa.10.0.i.i", 9 - %149 = lshr i64 %last_valid.i.i.i703, 6 - %150 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %last_valid.i.i.i703, 63 - %153 = shl nsw i64 -2, %152 - %154 = icmp eq i64 %152, 63 - %155 = select i1 %154, i64 0, i64 %153 - %156 = or i64 %151, %155 - store i64 %156, ptr %150, align 4 - %reass.sub.i.i.i704 = sub nsw i64 %149, %140 - %.not.i.i.i705 = icmp eq i64 %reass.sub.i.i.i704, -1 - br i1 %.not.i.i.i705, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -157: ; preds = %mask_block_ok.i.i.i706 - %158 = add nuw i64 %.02.i.i.i707, 1 - %exitcond.not.i.i.i710 = icmp eq i64 %.02.i.i.i707, %reass.sub.i.i.i704 - br i1 %exitcond.not.i.i.i710, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit", label %mask_block_ok.i.i.i706 - -mask_block_ok.i.i.i706: ; preds = %cond_548_case_0.i.i, %157 - %.02.i.i.i707 = phi i64 [ %158, %157 ], [ 0, %cond_548_case_0.i.i ] - %gep.i.i.i708 = getelementptr i64, ptr %141, i64 %.02.i.i.i707 - %159 = load i64, ptr %gep.i.i.i708, align 4 - %160 = icmp eq i64 %159, -1 - br i1 %160, label %157, label %mask_block_err.i.i.i709 - -mask_block_err.i.i.i709: ; preds = %mask_block_ok.i.i.i706 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +.thread: ; preds = %__barray_check_bounds.exit1620 + %90 = shl nuw nsw i64 1, %"363_0.sroa.15.01722" + %91 = xor i64 %87, %90 + store i64 %91, ptr %9, align 4 + %92 = getelementptr inbounds nuw i64, ptr %8, i64 %"363_0.sroa.15.01722" + %93 = load i64, ptr %92, align 4 + %94 = add i64 %"363_2.01721", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %93) + tail call void @___qfree(i64 %93) + %95 = icmp ult i64 %"363_2.01721", 10 + br i1 %95, label %__barray_check_bounds.exit1616, label %out_of_bounds.i1615 + +cond_exit_367: ; preds = %__barray_check_bounds.exit1616 + %96 = shl nuw nsw i64 1, %"363_2.01721" + %97 = xor i64 %80, %96 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i64, ptr %2, i64 %"363_2.01721" + store i64 %lazy_measure, ptr %98, align 4 + %99 = icmp samesign ugt i64 %"363_0.sroa.15.01722", 8 + br i1 %99, label %mask_block_ok.i, label %__barray_check_bounds.exit1620 + +loop_body311.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1624: ; preds = %cond_exit_433, %loop_body311.preheader.preheader + %"429_0.sroa.15.01708" = phi i64 [ %100, %cond_exit_433 ], [ 0, %loop_body311.preheader.preheader ] + %100 = add nuw nsw i64 %"429_0.sroa.15.01708", 1 + %101 = load i64, ptr %3, align 4 + %102 = lshr i64 %101, %"429_0.sroa.15.01708" + %103 = trunc i64 %102 to i1 + br i1 %103, label %panic.i1625, label %__barray_check_bounds.exit1628 + +panic.i1625: ; preds = %__barray_check_bounds.exit1624 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_548.thread.i.i, %loop_body.preheader.i.i - %"545_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %161, %cond_exit_548.thread.i.i ] - %161 = add nuw nsw i64 %"545_0.0239.i.i", 1 - %162 = add i64 %"545_0.0239.i.i", %"545_1.sroa.10.0.i.i" - %163 = lshr i64 %162, 6 - %164 = getelementptr inbounds nuw i64, ptr %"545_1.sroa.5.0.i.i", i64 %163 - %165 = load i64, ptr %164, align 4 - %166 = and i64 %162, 63 - %167 = lshr i64 %165, %166 - %168 = trunc i64 %167 to i1 - br i1 %168, label %cond_exit_548.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %169 = shl nuw i64 1, %166 - %170 = xor i64 %169, %165 - store i64 %170, ptr %164, align 4 - %171 = getelementptr inbounds i64, ptr %"545_1.sroa.0.0.i.i", i64 %162 - %172 = load i64, ptr %171, align 4 - tail call void @___dec_future_refcount(i64 %172) - br label %cond_exit_548.thread.i.i - -cond_exit_548.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %161, 10 - br i1 %exitcond.i.i, label %cond_548_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i699: ; preds = %__barray_check_bounds.exit221.i.i - %173 = xor i64 %137, %133 - store i64 %173, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) - tail call void @___dec_future_refcount(i64 %136) - %174 = load i64, ptr %123, align 4 - %175 = lshr i64 %174, %"280_0.sroa.15.0168.i" - %176 = trunc i64 %175 to i1 - br i1 %176, label %loop_body.i701, label %panic.i.i700 +__barray_check_bounds.exit1628: ; preds = %__barray_check_bounds.exit1624 + %104 = shl nuw nsw i64 1, %"429_0.sroa.15.01708" + %105 = xor i64 %101, %104 + store i64 %105, ptr %3, align 4 + %106 = getelementptr inbounds nuw i64, ptr %2, i64 %"429_0.sroa.15.01708" + %107 = load i64, ptr %106, align 4 + tail call void @___inc_future_refcount(i64 %107) + %108 = load i64, ptr %3, align 4 + %109 = lshr i64 %108, %"429_0.sroa.15.01708" + %110 = trunc i64 %109 to i1 + br i1 %110, label %__barray_check_bounds.exit1632, label %panic.i1629 + +panic.i1629: ; preds = %__barray_check_bounds.exit1628 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -panic.i.i700: ; preds = %__barray_check_bounds.exit.i699 +__barray_check_bounds.exit1632: ; preds = %__barray_check_bounds.exit1628 + %111 = xor i64 %108, %104 + store i64 %111, ptr %3, align 4 + store i64 %107, ptr %106, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %107) + tail call void @___dec_future_refcount(i64 %107) + %112 = load i64, ptr %1, align 4 + %113 = lshr i64 %112, %"429_0.sroa.15.01708" + %114 = trunc i64 %113 to i1 + br i1 %114, label %cond_exit_433, label %panic.i1633 + +panic.i1633: ; preds = %__barray_check_bounds.exit1632 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i701: ; preds = %__barray_check_bounds.exit.i699 - %177 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %178 = shl nuw nsw i64 1, %"280_0.sroa.15.0168.i" - %179 = xor i64 %174, %178 - store i64 %179, ptr %123, align 4 - %180 = getelementptr inbounds nuw i1, ptr %122, i64 %"280_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %180, align 1 - %181 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i702 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i702, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i698 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit": ; preds = %157, %cond_548_case_0.i.i - tail call void @heap_free(ptr %"545_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"545_1.sroa.5.0.i.i") - %182 = load i64, ptr %123, align 4 - %183 = and i64 %182, 1023 - store i64 %183, ptr %123, align 4 - %184 = icmp eq i64 %183, 0 - br i1 %184, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" - %185 = tail call ptr @heap_alloc(i64 10) - %186 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %186, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %185, ptr noundef nonnull align 1 dereferenceable(10) %122, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %185) - %187 = load i64, ptr %123, align 4 - %188 = and i64 %187, 1023 - store i64 %188, ptr %123, align 4 - %189 = icmp eq i64 %188, 0 - br i1 %189, label %__barray_check_none_borrowed.exit720, label %mask_block_err.i718 - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.266.exit" +mask_block_err.i1638: ; preds = %cond_exit_603.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1646: ; preds = %__barray_check_bounds.exit1642.preheader + %115 = or disjoint i64 %168, 1 + store i64 %115, ptr %3, align 4 + %116 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_603 + +cond_exit_603: ; preds = %__barray_mask_borrow.exit1646, %__barray_check_bounds.exit1642.preheader + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 2 + %.not1733 = icmp eq i64 %118, 0 + br i1 %.not1733, label %__barray_mask_borrow.exit1646.1, label %cond_exit_603.1 + +__barray_mask_borrow.exit1646.1: ; preds = %cond_exit_603 + %119 = or disjoint i64 %117, 2 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_603.1 + +cond_exit_603.1: ; preds = %__barray_mask_borrow.exit1646.1, %cond_exit_603 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 4 + %.not1734 = icmp eq i64 %123, 0 + br i1 %.not1734, label %__barray_mask_borrow.exit1646.2, label %cond_exit_603.2 + +__barray_mask_borrow.exit1646.2: ; preds = %cond_exit_603.1 + %124 = or disjoint i64 %122, 4 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_603.2 + +cond_exit_603.2: ; preds = %__barray_mask_borrow.exit1646.2, %cond_exit_603.1 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 8 + %.not1735 = icmp eq i64 %128, 0 + br i1 %.not1735, label %__barray_mask_borrow.exit1646.3, label %cond_exit_603.3 + +__barray_mask_borrow.exit1646.3: ; preds = %cond_exit_603.2 + %129 = or disjoint i64 %127, 8 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_603.3 + +cond_exit_603.3: ; preds = %__barray_mask_borrow.exit1646.3, %cond_exit_603.2 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 16 + %.not1736 = icmp eq i64 %133, 0 + br i1 %.not1736, label %__barray_mask_borrow.exit1646.4, label %cond_exit_603.4 + +__barray_mask_borrow.exit1646.4: ; preds = %cond_exit_603.3 + %134 = or disjoint i64 %132, 16 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_603.4 + +cond_exit_603.4: ; preds = %__barray_mask_borrow.exit1646.4, %cond_exit_603.3 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 32 + %.not1737 = icmp eq i64 %138, 0 + br i1 %.not1737, label %__barray_mask_borrow.exit1646.5, label %cond_exit_603.5 + +__barray_mask_borrow.exit1646.5: ; preds = %cond_exit_603.4 + %139 = or disjoint i64 %137, 32 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_603.5 + +cond_exit_603.5: ; preds = %__barray_mask_borrow.exit1646.5, %cond_exit_603.4 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 64 + %.not1738 = icmp eq i64 %143, 0 + br i1 %.not1738, label %__barray_mask_borrow.exit1646.6, label %cond_exit_603.6 + +__barray_mask_borrow.exit1646.6: ; preds = %cond_exit_603.5 + %144 = or disjoint i64 %142, 64 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_603.6 + +cond_exit_603.6: ; preds = %__barray_mask_borrow.exit1646.6, %cond_exit_603.5 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 128 + %.not1739 = icmp eq i64 %148, 0 + br i1 %.not1739, label %__barray_mask_borrow.exit1646.7, label %cond_exit_603.7 + +__barray_mask_borrow.exit1646.7: ; preds = %cond_exit_603.6 + %149 = or disjoint i64 %147, 128 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_603.7 + +cond_exit_603.7: ; preds = %__barray_mask_borrow.exit1646.7, %cond_exit_603.6 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 256 + %.not1740 = icmp eq i64 %153, 0 + br i1 %.not1740, label %__barray_mask_borrow.exit1646.8, label %cond_exit_603.8 + +__barray_mask_borrow.exit1646.8: ; preds = %cond_exit_603.7 + %154 = or disjoint i64 %152, 256 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_603.8 + +cond_exit_603.8: ; preds = %__barray_mask_borrow.exit1646.8, %cond_exit_603.7 + %157 = load i64, ptr %3, align 4 + %158 = and i64 %157, 512 + %.not1741 = icmp eq i64 %158, 0 + br i1 %.not1741, label %__barray_mask_borrow.exit1646.9, label %cond_exit_603.9 + +__barray_mask_borrow.exit1646.9: ; preds = %cond_exit_603.8 + %159 = or disjoint i64 %157, 512 + store i64 %159, ptr %3, align 4 + %160 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %161 = load i64, ptr %160, align 4 + tail call void @___dec_future_refcount(i64 %161) + br label %cond_exit_603.9 + +cond_exit_603.9: ; preds = %__barray_mask_borrow.exit1646.9, %cond_exit_603.8 + %162 = load i64, ptr %3, align 4 + %163 = or i64 %162, -1024 + store i64 %163, ptr %3, align 4 + %164 = icmp eq i64 %163, -1 + br i1 %164, label %loop_out310, label %mask_block_err.i1638 + +cond_exit_433: ; preds = %__barray_check_bounds.exit1632 + %165 = xor i64 %112, %104 + store i64 %165, ptr %1, align 4 + %166 = getelementptr inbounds nuw i1, ptr %0, i64 %"429_0.sroa.15.01708" + store i1 %read_bool, ptr %166, align 1 + %167 = icmp eq i64 %"429_0.sroa.15.01708", 9 + br i1 %167, label %__barray_check_bounds.exit1642.preheader, label %__barray_check_bounds.exit1624 + +__barray_check_bounds.exit1642.preheader: ; preds = %cond_exit_433 + %168 = load i64, ptr %3, align 4 + %169 = trunc i64 %168 to i1 + br i1 %169, label %cond_exit_603, label %__barray_mask_borrow.exit1646 + +loop_out310: ; preds = %cond_exit_603.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1649 + +__barray_check_none_borrowed.exit: ; preds = %loop_out310 + %173 = tail call ptr @heap_alloc(i64 10) + %174 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %174, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %173) + %175 = load i64, ptr %1, align 4 + %176 = and i64 %175, 1023 + store i64 %176, ptr %1, align 4 + %177 = icmp eq i64 %176, 0 + br i1 %177, label %__barray_check_none_borrowed.exit1655, label %mask_block_err.i1653 + +mask_block_err.i1649: ; preds = %loop_out310 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit720: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1655: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %190 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %190, i8 0, i64 10, i1 false) + %178 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %178, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %122, ptr %arr_ptr, align 8 - store ptr %190, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %178, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit728 + br label %__barray_check_bounds.exit1657 -mask_block_err.i718: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i1653: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit728: ; preds = %cond_exit_94.1, %__barray_check_none_borrowed.exit720 - %"89_0.sroa.0.0778" = phi i64 [ 0, %__barray_check_none_borrowed.exit720 ], [ %207, %cond_exit_94.1 ] - %191 = lshr i64 %"89_0.sroa.0.0778", 6 - %192 = getelementptr inbounds nuw i64, ptr %3, i64 %191 - %193 = load i64, ptr %192, align 4 - %194 = and i64 %"89_0.sroa.0.0778", 62 - %195 = lshr i64 %193, %194 - %196 = trunc i64 %195 to i1 - br i1 %196, label %cond_exit_94, label %panic.i729 - -panic.i729: ; preds = %cond_exit_94, %__barray_check_bounds.exit728 +__barray_check_bounds.exit1657: ; preds = %cond_exit_147.1, %__barray_check_none_borrowed.exit1655 + %"143_2.01709" = phi i64 [ 0, %__barray_check_none_borrowed.exit1655 ], [ %195, %cond_exit_147.1 ] + %179 = lshr i64 %"143_2.01709", 6 + %180 = getelementptr inbounds nuw i64, ptr %7, i64 %179 + %181 = load i64, ptr %180, align 4 + %182 = and i64 %"143_2.01709", 62 + %183 = lshr i64 %181, %182 + %184 = trunc i64 %183 to i1 + br i1 %184, label %cond_exit_147, label %panic.i1658 + +panic.i1658: ; preds = %cond_exit_147, %__barray_check_bounds.exit1657 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_94: ; preds = %__barray_check_bounds.exit728 - %197 = or disjoint i64 %"89_0.sroa.0.0778", 1 - %198 = shl nuw nsw i64 1, %194 - %199 = xor i64 %193, %198 - store i64 %199, ptr %192, align 4 - %200 = getelementptr inbounds nuw i64, ptr %2, i64 %"89_0.sroa.0.0778" - store i64 %"89_0.sroa.0.0778", ptr %200, align 4 - %201 = lshr i64 %"89_0.sroa.0.0778", 6 - %202 = getelementptr inbounds nuw i64, ptr %3, i64 %201 - %203 = load i64, ptr %202, align 4 - %204 = and i64 %197, 63 - %205 = lshr i64 %203, %204 - %206 = trunc i64 %205 to i1 - br i1 %206, label %cond_exit_94.1, label %panic.i729 - -cond_exit_94.1: ; preds = %cond_exit_94 - %207 = add nuw nsw i64 %"89_0.sroa.0.0778", 2 - %208 = shl nuw i64 1, %204 - %209 = xor i64 %203, %208 - store i64 %209, ptr %202, align 4 - %210 = getelementptr inbounds nuw i64, ptr %2, i64 %197 - store i64 %197, ptr %210, align 4 - %exitcond781.not.1 = icmp eq i64 %207, 100 - br i1 %exitcond781.not.1, label %loop_out127, label %__barray_check_bounds.exit728 - -loop_out127: ; preds = %cond_exit_94.1 - %211 = getelementptr inbounds nuw i8, ptr %3, i64 8 - %212 = load i64, ptr %211, align 4 - %213 = and i64 %212, 68719476735 - store i64 %213, ptr %211, align 4 - %214 = load i64, ptr %3, align 4 - %215 = icmp eq i64 %214, 0 - %216 = icmp eq i64 %213, 0 - %or.cond = select i1 %215, i1 %216, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit735, label %mask_block_err.i733 - -__barray_check_none_borrowed.exit735: ; preds = %loop_out127 - %217 = call ptr @heap_alloc(i64 800) - %218 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %218, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %217, ptr noundef nonnull align 1 dereferenceable(800) %2, i64 800, i1 false) - call void @heap_free(ptr nonnull %217) - %219 = load i64, ptr %211, align 4 - %220 = and i64 %219, 68719476735 - store i64 %220, ptr %211, align 4 - %221 = load i64, ptr %3, align 4 - %222 = icmp eq i64 %221, 0 - %223 = icmp eq i64 %220, 0 - %or.cond783 = select i1 %222, i1 %223, i1 false - br i1 %or.cond783, label %__barray_check_none_borrowed.exit740, label %mask_block_err.i738 - -mask_block_err.i733: ; preds = %loop_out127 +cond_exit_147: ; preds = %__barray_check_bounds.exit1657 + %185 = or disjoint i64 %"143_2.01709", 1 + %186 = shl nuw nsw i64 1, %182 + %187 = xor i64 %181, %186 + store i64 %187, ptr %180, align 4 + %188 = getelementptr inbounds nuw i64, ptr %6, i64 %"143_2.01709" + store i64 %"143_2.01709", ptr %188, align 4 + %189 = lshr i64 %"143_2.01709", 6 + %190 = getelementptr inbounds nuw i64, ptr %7, i64 %189 + %191 = load i64, ptr %190, align 4 + %192 = and i64 %185, 63 + %193 = lshr i64 %191, %192 + %194 = trunc i64 %193 to i1 + br i1 %194, label %cond_exit_147.1, label %panic.i1658 + +cond_exit_147.1: ; preds = %cond_exit_147 + %195 = add nuw nsw i64 %"143_2.01709", 2 + %196 = shl nuw i64 1, %192 + %197 = xor i64 %191, %196 + store i64 %197, ptr %190, align 4 + %198 = getelementptr inbounds nuw i64, ptr %6, i64 %185 + store i64 %185, ptr %198, align 4 + %exitcond1713.1 = icmp eq i64 %195, 100 + br i1 %exitcond1713.1, label %loop_out529, label %__barray_check_bounds.exit1657 + +loop_out529: ; preds = %cond_exit_147.1 + %199 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %200 = load i64, ptr %199, align 4 + %201 = and i64 %200, 68719476735 + store i64 %201, ptr %199, align 4 + %202 = load i64, ptr %7, align 4 + %203 = icmp eq i64 %202, 0 + %204 = icmp eq i64 %201, 0 + %or.cond = select i1 %203, i1 %204, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1664, label %mask_block_err.i1662 + +__barray_check_none_borrowed.exit1664: ; preds = %loop_out529 + %205 = call ptr @heap_alloc(i64 800) + %206 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %206, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %205, ptr noundef nonnull align 1 dereferenceable(800) %6, i64 800, i1 false) + call void @heap_free(ptr nonnull %205) + %207 = load i64, ptr %199, align 4 + %208 = and i64 %207, 68719476735 + store i64 %208, ptr %199, align 4 + %209 = load i64, ptr %7, align 4 + %210 = icmp eq i64 %209, 0 + %211 = icmp eq i64 %208, 0 + %or.cond1718 = select i1 %210, i1 %211, i1 false + br i1 %or.cond1718, label %__barray_check_none_borrowed.exit1669, label %mask_block_err.i1667 + +mask_block_err.i1662: ; preds = %loop_out529 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit740: ; preds = %__barray_check_none_borrowed.exit735 - %out_arr_alloca203 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr205 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 4 - %arr_ptr206 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 8 - %mask_ptr207 = getelementptr inbounds nuw i8, ptr %out_arr_alloca203, i64 16 - %224 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %224, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca203, align 8 - store i32 1, ptr %y_ptr205, align 4 - store ptr %2, ptr %arr_ptr206, align 8 - store ptr %224, ptr %mask_ptr207, align 8 - call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca203) - br label %__barray_check_bounds.exit748 - -mask_block_err.i738: ; preds = %__barray_check_none_borrowed.exit735 +__barray_check_none_borrowed.exit1669: ; preds = %__barray_check_none_borrowed.exit1664 + %out_arr_alloca692 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr694 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 4 + %arr_ptr695 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 8 + %mask_ptr696 = getelementptr inbounds nuw i8, ptr %out_arr_alloca692, i64 16 + %212 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %212, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca692, align 8 + store i32 1, ptr %y_ptr694, align 4 + store ptr %6, ptr %arr_ptr695, align 8 + store ptr %212, ptr %mask_ptr696, align 8 + call void @print_int_arr(ptr nonnull @res_is.F21393DB.0, i64 14, ptr nonnull %out_arr_alloca692) + br label %__barray_check_bounds.exit1671 + +mask_block_err.i1667: ; preds = %__barray_check_none_borrowed.exit1664 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit748: ; preds = %cond_exit_129, %__barray_check_none_borrowed.exit740 - %"124_0.sroa.0.0780" = phi i64 [ 0, %__barray_check_none_borrowed.exit740 ], [ %233, %cond_exit_129 ] - %225 = lshr i64 %"124_0.sroa.0.0780", 6 - %226 = getelementptr inbounds nuw i64, ptr %1, i64 %225 - %227 = load i64, ptr %226, align 4 - %228 = and i64 %"124_0.sroa.0.0780", 63 - %229 = lshr i64 %227, %228 - %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_129, label %panic.i749 - -panic.i749: ; preds = %__barray_check_bounds.exit748 +__barray_check_bounds.exit1671: ; preds = %cond_exit_253, %__barray_check_none_borrowed.exit1669 + %"249_2.01711" = phi i64 [ 0, %__barray_check_none_borrowed.exit1669 ], [ %221, %cond_exit_253 ] + %213 = lshr i64 %"249_2.01711", 6 + %214 = getelementptr inbounds nuw i64, ptr %5, i64 %213 + %215 = load i64, ptr %214, align 4 + %216 = and i64 %"249_2.01711", 63 + %217 = lshr i64 %215, %216 + %218 = trunc i64 %217 to i1 + br i1 %218, label %cond_exit_253, label %panic.i1672 + +panic.i1672: ; preds = %__barray_check_bounds.exit1671 call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_129: ; preds = %__barray_check_bounds.exit748 - %231 = uitofp nneg i64 %"124_0.sroa.0.0780" to double - %232 = fmul double %231, 6.250000e-02 - %233 = add nuw nsw i64 %"124_0.sroa.0.0780", 1 - %234 = shl nuw i64 1, %228 - %235 = xor i64 %227, %234 - store i64 %235, ptr %226, align 4 - %236 = getelementptr inbounds nuw double, ptr %0, i64 %"124_0.sroa.0.0780" - store double %232, ptr %236, align 8 - %exitcond782.not = icmp eq i64 %233, 100 - br i1 %exitcond782.not, label %loop_out211, label %__barray_check_bounds.exit748 - -loop_out211: ; preds = %cond_exit_129 - %237 = getelementptr inbounds nuw i8, ptr %1, i64 8 - %238 = load i64, ptr %237, align 4 - %239 = and i64 %238, 68719476735 - store i64 %239, ptr %237, align 4 - %240 = load i64, ptr %1, align 4 - %241 = icmp eq i64 %240, 0 - %242 = icmp eq i64 %239, 0 - %or.cond784 = select i1 %241, i1 %242, i1 false - br i1 %or.cond784, label %__barray_check_none_borrowed.exit755, label %mask_block_err.i753 - -__barray_check_none_borrowed.exit755: ; preds = %loop_out211 - %243 = call ptr @heap_alloc(i64 800) - %244 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %244, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %243, ptr noundef nonnull align 1 dereferenceable(800) %0, i64 800, i1 false) - call void @heap_free(ptr nonnull %243) - %245 = load i64, ptr %237, align 4 - %246 = and i64 %245, 68719476735 - store i64 %246, ptr %237, align 4 - %247 = load i64, ptr %1, align 4 - %248 = icmp eq i64 %247, 0 - %249 = icmp eq i64 %246, 0 - %or.cond785 = select i1 %248, i1 %249, i1 false - br i1 %or.cond785, label %__barray_check_none_borrowed.exit760, label %mask_block_err.i758 - -mask_block_err.i753: ; preds = %loop_out211 +cond_exit_253: ; preds = %__barray_check_bounds.exit1671 + %219 = uitofp nneg i64 %"249_2.01711" to double + %220 = fmul double %219, 6.250000e-02 + %221 = add nuw nsw i64 %"249_2.01711", 1 + %222 = shl nuw i64 1, %216 + %223 = xor i64 %215, %222 + store i64 %223, ptr %214, align 4 + %224 = getelementptr inbounds nuw double, ptr %4, i64 %"249_2.01711" + store double %220, ptr %224, align 8 + %exitcond1714 = icmp eq i64 %221, 100 + br i1 %exitcond1714, label %loop_out700, label %__barray_check_bounds.exit1671 + +loop_out700: ; preds = %cond_exit_253 + %225 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %226 = load i64, ptr %225, align 4 + %227 = and i64 %226, 68719476735 + store i64 %227, ptr %225, align 4 + %228 = load i64, ptr %5, align 4 + %229 = icmp eq i64 %228, 0 + %230 = icmp eq i64 %227, 0 + %or.cond1719 = select i1 %229, i1 %230, i1 false + br i1 %or.cond1719, label %__barray_check_none_borrowed.exit1678, label %mask_block_err.i1676 + +__barray_check_none_borrowed.exit1678: ; preds = %loop_out700 + %231 = call ptr @heap_alloc(i64 800) + %232 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %232, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %231, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %231) + %233 = load i64, ptr %225, align 4 + %234 = and i64 %233, 68719476735 + store i64 %234, ptr %225, align 4 + %235 = load i64, ptr %5, align 4 + %236 = icmp eq i64 %235, 0 + %237 = icmp eq i64 %234, 0 + %or.cond1720 = select i1 %236, i1 %237, i1 false + br i1 %or.cond1720, label %__barray_check_none_borrowed.exit1683, label %mask_block_err.i1681 + +mask_block_err.i1676: ; preds = %loop_out700 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit760: ; preds = %__barray_check_none_borrowed.exit755 - %out_arr_alloca290 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr292 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 4 - %arr_ptr293 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 8 - %mask_ptr294 = getelementptr inbounds nuw i8, ptr %out_arr_alloca290, i64 16 - %250 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %250, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca290, align 8 - store i32 1, ptr %y_ptr292, align 4 - store ptr %0, ptr %arr_ptr293, align 8 - store ptr %250, ptr %mask_ptr294, align 8 - call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca290) +__barray_check_none_borrowed.exit1683: ; preds = %__barray_check_none_borrowed.exit1678 + %out_arr_alloca866 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr868 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 4 + %arr_ptr869 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 8 + %mask_ptr870 = getelementptr inbounds nuw i8, ptr %out_arr_alloca866, i64 16 + %238 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %238, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca866, align 8 + store i32 1, ptr %y_ptr868, align 4 + store ptr %4, ptr %arr_ptr869, align 8 + store ptr %238, ptr %mask_ptr870, align 8 + call void @print_float_arr(ptr nonnull @res_fs.CBD4AF54.0, i64 16, ptr nonnull %out_arr_alloca866) ret void -mask_block_err.i758: ; preds = %__barray_check_none_borrowed.exit755 +mask_block_err.i1681: ; preds = %__barray_check_none_borrowed.exit1678 call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable } @@ -759,26 +784,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-apple-darwin.ll index fc0cc042..89719611 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-apple-darwin.ll @@ -13,30 +13,32 @@ target triple = "aarch64-apple-darwin" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-unknown-linux-gnu.ll index 4ee8a4d6..4c8ba3d8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-aarch64-unknown-linux-gnu.ll @@ -13,30 +13,32 @@ target triple = "aarch64-unknown-linux-gnu" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-apple-darwin.ll index ad2c5b28..55cd7576 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-apple-darwin.ll @@ -13,30 +13,32 @@ target triple = "x86_64-apple-darwin" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-unknown-linux-gnu.ll index 3ffea5c5..af9fcd4e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-unknown-linux-gnu.ll @@ -13,30 +13,32 @@ target triple = "x86_64-unknown-linux-gnu" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-windows-gnu.ll index 30768e68..b98c48f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-helios-x86_64-windows-gnu.ll @@ -13,30 +13,32 @@ target triple = "x86_64-windows-gnu" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-apple-darwin.ll index fc0cc042..89719611 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-apple-darwin.ll @@ -13,30 +13,32 @@ target triple = "aarch64-apple-darwin" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-unknown-linux-gnu.ll index 4ee8a4d6..4c8ba3d8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-aarch64-unknown-linux-gnu.ll @@ -13,30 +13,32 @@ target triple = "aarch64-unknown-linux-gnu" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-apple-darwin.ll index ad2c5b28..55cd7576 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-apple-darwin.ll @@ -13,30 +13,32 @@ target triple = "x86_64-apple-darwin" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-unknown-linux-gnu.ll index 3ffea5c5..af9fcd4e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-unknown-linux-gnu.ll @@ -13,30 +13,32 @@ target triple = "x86_64-unknown-linux-gnu" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-windows-gnu.ll index 30768e68..b98c48f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng/rng-sol-x86_64-windows-gnu.ll @@ -13,30 +13,32 @@ target triple = "x86_64-windows-gnu" define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: + tail call void @random_seed(i64 84) tail call void @random_seed(i64 42) %rint = tail call i32 @random_int() - %rint14 = tail call i32 @random_int() + %rint24 = tail call i32 @random_int() %rfloat = tail call double @random_float() %rintb = tail call i32 @random_rng(i32 100) %0 = sext i32 %rintb to i64 - %1 = sext i32 %rint14 to i64 + %1 = sext i32 %rint24 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_int(ptr nonnull @res_rint1.0884EC03.0, i64 14, i64 %1) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint_bnd.CB1E6B0D.0, i64 17, i64 %0) - tail call void @random_seed(i64 84) - %rint47 = tail call i32 @random_int() - %rfloat49 = tail call double @random_float() - %rintb52 = tail call i32 @random_rng(i32 200) - %3 = sext i32 %rintb52 to i64 - %4 = sext i32 %rint47 to i64 + %rint65 = tail call i32 @random_int() + %rfloat67 = tail call double @random_float() + %rintb70 = tail call i32 @random_rng(i32 200) + %3 = sext i32 %rintb70 to i64 + %4 = sext i32 %rint65 to i64 tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %4) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat49) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat67) tail call void @print_int(ptr nonnull @res_rint_bnd2.169DE399.0, i64 18, i64 %3) ret void } +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -47,8 +49,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-apple-darwin.ll index d00995f3..1f927f52 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-apple-darwin.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-unknown-linux-gnu.ll index ac626626..f0a60107 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-aarch64-unknown-linux-gnu.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-apple-darwin.ll index 0e8d1ed1..1a7a2e16 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-apple-darwin.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-unknown-linux-gnu.ll index c13aa848..a2982a57 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-unknown-linux-gnu.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-windows-gnu.ll index 3caa3797..ac4b9dd5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-helios-x86_64-windows-gnu.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-apple-darwin.ll index d00995f3..1f927f52 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-apple-darwin.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-unknown-linux-gnu.ll index ac626626..f0a60107 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-aarch64-unknown-linux-gnu.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-apple-darwin.ll index 0e8d1ed1..1a7a2e16 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-apple-darwin.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-unknown-linux-gnu.ll index c13aa848..a2982a57 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-unknown-linux-gnu.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-windows-gnu.ll index 3caa3797..ac4b9dd5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rng_advance/rng_advance-sol-x86_64-windows-gnu.ll @@ -16,19 +16,21 @@ alloca_block: %rint = tail call i32 @random_int() %rfloat = tail call double @random_float() tail call void @random_advance(i64 -2) - %rint9 = tail call i32 @random_int() - %rfloat11 = tail call double @random_float() - %1 = sext i32 %rint9 to i64 + %rint16 = tail call i32 @random_int() + %rfloat18 = tail call double @random_float() + %1 = sext i32 %rint16 to i64 %2 = sext i32 %rint to i64 tail call void @print_int(ptr nonnull @res_rint.B928E41E.0, i64 13, i64 %2) tail call void @print_float(ptr nonnull @res_rfloat.F0E4DD2C.0, i64 17, double %rfloat) tail call void @print_int(ptr nonnull @res_rint2.F0335598.0, i64 14, i64 %1) - tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat11) + tail call void @print_float(ptr nonnull @res_rfloat2.4DAB941F.0, i64 18, double %rfloat18) ret void } declare i64 @get_current_shot() local_unnamed_addr +declare void @random_seed(i64) local_unnamed_addr + declare i32 @random_int() local_unnamed_addr declare double @random_float() local_unnamed_addr @@ -39,8 +41,6 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr declare void @print_float(ptr, i64, double) local_unnamed_addr -declare void @random_seed(i64) local_unnamed_addr - define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-apple-darwin.ll index d5c4927d..fcaf7e69 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-apple-darwin.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_helios_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_helios_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i +__hugr__.__tk2_helios_qalloc.44.exit69: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_helios_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_helios_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i +__hugr__.__tk2_helios_qalloc.44.exit73: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-unknown-linux-gnu.ll index 20695e27..8fa74520 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-aarch64-unknown-linux-gnu.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_helios_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_helios_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i +__hugr__.__tk2_helios_qalloc.44.exit69: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_helios_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_helios_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i +__hugr__.__tk2_helios_qalloc.44.exit73: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-apple-darwin.ll index 5e83c543..e2834faa 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-apple-darwin.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_helios_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_helios_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i +__hugr__.__tk2_helios_qalloc.44.exit69: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_helios_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_helios_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i +__hugr__.__tk2_helios_qalloc.44.exit73: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-unknown-linux-gnu.ll index d4c65823..d3ab0197 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-unknown-linux-gnu.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_helios_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_helios_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i +__hugr__.__tk2_helios_qalloc.44.exit69: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_helios_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_helios_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i +__hugr__.__tk2_helios_qalloc.44.exit73: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-windows-gnu.ll index 0d1da358..6c22e206 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-helios-x86_64-windows-gnu.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_helios_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_helios_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i +__hugr__.__tk2_helios_qalloc.44.exit69: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_helios_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_helios_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_helios_qalloc.111.exit.i +__hugr__.__tk2_helios_qalloc.44.exit73: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_helios_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rxy(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-apple-darwin.ll index a4d5db07..62c79113 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-apple-darwin.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_sol_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_sol_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i +__hugr__.__tk2_sol_qalloc.44.exit69: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_sol_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rp(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_sol_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i +__hugr__.__tk2_sol_qalloc.44.exit73: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-unknown-linux-gnu.ll index 5589c205..310a8438 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-aarch64-unknown-linux-gnu.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_sol_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_sol_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i +__hugr__.__tk2_sol_qalloc.44.exit69: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_sol_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rp(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_sol_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i +__hugr__.__tk2_sol_qalloc.44.exit73: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-apple-darwin.ll index 1ec93045..1c97f622 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-apple-darwin.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_sol_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_sol_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i +__hugr__.__tk2_sol_qalloc.44.exit69: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_sol_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rp(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_sol_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i +__hugr__.__tk2_sol_qalloc.44.exit73: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-unknown-linux-gnu.ll index 9169dc9d..02199552 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-unknown-linux-gnu.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_sol_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_sol_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i +__hugr__.__tk2_sol_qalloc.44.exit69: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_sol_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rp(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_sol_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i +__hugr__.__tk2_sol_qalloc.44.exit73: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-windows-gnu.ll index 2c1da596..1e3a5be7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_rus/repeat_until_success-sol-x86_64-windows-gnu.ll @@ -10,86 +10,86 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_87_case_0.i, label %__hugr__.__tk2_sol_qalloc.83.exit + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_87_case_0.i: ; preds = %alloca_block +cond_48_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.83.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %qalloc.i97.i = tail call i64 @___qalloc() - %not_max.not.not.i98.i = icmp eq i64 %qalloc.i97.i, -1 - br i1 %not_max.not.not.i98.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i + %qalloc.i6676 = tail call i64 @___qalloc() + %not_max.not.not.i6777 = icmp eq i64 %qalloc.i6676, -1 + br i1 %not_max.not.not.i6777, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 -cond_101_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.83.exit +cond_48_case_0.i68: ; preds = %.backedge, %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.97.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.83.exit, %.backedge.i - %qalloc.i99.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i97.i, %__hugr__.__tk2_sol_qalloc.83.exit ] - tail call void @___reset(i64 %qalloc.i99.i) - %qalloc.i93.i = tail call i64 @___qalloc() - %not_max.not.not.i94.i = icmp eq i64 %qalloc.i93.i, -1 - br i1 %not_max.not.not.i94.i, label %cond_115_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.111.exit.i - -cond_115_case_0.i.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i +__hugr__.__tk2_sol_qalloc.44.exit69: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit, %.backedge + %qalloc.i6678 = phi i64 [ %qalloc.i66, %.backedge ], [ %qalloc.i6676, %__hugr__.__tk2_sol_qalloc.44.exit ] + tail call void @___reset(i64 %qalloc.i6678) + tail call void @___rp(i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0xBFE921FB54442D18) + %qalloc.i70 = tail call i64 @___qalloc() + %not_max.not.not.i71 = icmp eq i64 %qalloc.i70, -1 + br i1 %not_max.not.not.i71, label %cond_48_case_0.i72, label %__hugr__.__tk2_sol_qalloc.44.exit73 + +cond_48_case_0.i72: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.111.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.97.exit.i - tail call void @___reset(i64 %qalloc.i93.i) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x400921FB54442D18) - tail call void @___rp(i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0xBFE921FB54442D18) - tail call void @___rp(i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i93.i, i64 %qalloc.i99.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i99.i, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i99.i, double 0x3FE921FB54442D18) - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %qalloc.i99.i) - tail call void @___qfree(i64 %qalloc.i99.i) - %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) - tail call void @___dec_future_refcount(i64 %lazy_measure.i) - br i1 %read_bool.i, label %1, label %0 - -0: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i - tail call void @___qfree(i64 %qalloc.i93.i) - br label %.backedge.i - -.backedge.i: ; preds = %2, %0 - %qalloc.i.i = tail call i64 @___qalloc() - %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_101_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.97.exit.i - -1: ; preds = %__hugr__.__tk2_sol_qalloc.111.exit.i +__hugr__.__tk2_sol_qalloc.44.exit73: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit69 + tail call void @___reset(i64 %qalloc.i70) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0x400921FB54442D18) + tail call void @___rp(i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i70, i64 %qalloc.i6678, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i6678, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i70, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i6678, double 0x3FE921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i6678) + tail call void @___qfree(i64 %qalloc.i6678) + %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) + tail call void @___dec_future_refcount(i64 %lazy_measure) + br i1 %read_bool, label %1, label %0 + +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 + tail call void @___qfree(i64 %qalloc.i70) + br label %.backedge + +.backedge: ; preds = %0, %2 + %qalloc.i66 = tail call i64 @___qalloc() + %not_max.not.not.i67 = icmp eq i64 %qalloc.i66, -1 + br i1 %not_max.not.not.i67, label %cond_48_case_0.i68, label %__hugr__.__tk2_sol_qalloc.44.exit69 + +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit73 tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i93.i, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i93.i, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i70, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i70, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i93.i, double 0x3FE921FB54442D18) - %lazy_measure52.i = tail call i64 @___lazy_measure(i64 %qalloc.i93.i) - tail call void @___qfree(i64 %qalloc.i93.i) - %read_bool54.i = tail call i1 @___read_future_bool(i64 %lazy_measure52.i) - tail call void @___dec_future_refcount(i64 %lazy_measure52.i) - br i1 %read_bool54.i, label %__hugr__.__main__.rus.17.exit, label %2 + tail call void @___rz(i64 %qalloc.i70, double 0x3FE921FB54442D18) + %lazy_measure33 = tail call i64 @___lazy_measure(i64 %qalloc.i70) + tail call void @___qfree(i64 %qalloc.i70) + %read_bool35 = tail call i1 @___read_future_bool(i64 %lazy_measure33) + tail call void @___dec_future_refcount(i64 %lazy_measure33) + br i1 %read_bool35, label %3, label %2 2: ; preds = %1 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - br label %.backedge.i + br label %.backedge -__hugr__.__main__.rus.17.exit: ; preds = %1 - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) +3: ; preds = %1 + %lazy_measure48 = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) - tail call void @___dec_future_refcount(i64 %lazy_measure) - tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool) + %read_bool50 = tail call i1 @___read_future_bool(i64 %lazy_measure48) + tail call void @___dec_future_refcount(i64 %lazy_measure48) + tail call void @print_bool(ptr nonnull @res_result.457DE32D.0, i64 16, i1 %read_bool50) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-apple-darwin.ll index 5f677fc7..df2bb845 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-apple-darwin.ll @@ -5,467 +5,447 @@ target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-unknown-linux-gnu.ll index 96f528b0..bc26a9a7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-aarch64-unknown-linux-gnu.ll @@ -5,467 +5,447 @@ target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-apple-darwin.ll index 78788651..a3bd39e6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-apple-darwin.ll @@ -5,467 +5,447 @@ target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-unknown-linux-gnu.ll index 98d80e82..860f9124 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-unknown-linux-gnu.ll @@ -5,467 +5,447 @@ target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-windows-gnu.ll index a1fa25e9..159548e0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-helios-x86_64-windows-gnu.ll @@ -5,467 +5,447 @@ target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit + br i1 %not_max.not.not.i, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit -cond_447_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_359_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.420.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.355.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.420.exit.1, %__hugr__.__tk2_helios_qalloc.420.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.355.exit.1, %__hugr__.__tk2_helios_qalloc.355.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_447_case_0.i, label %__hugr__.__tk2_helios_qalloc.420.exit.1 + br i1 %not_max.not.not.i.1, label %cond_359_case_0.i, label %__hugr__.__tk2_helios_qalloc.355.exit.1 -__hugr__.__tk2_helios_qalloc.420.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.355.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.420.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.355.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_447_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_359_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rzz(i64 %24, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %20, i64 %27, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %27, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0x3FE921FB54442D18) + tail call void @___rzz(i64 %20, i64 %24, double 0x3FE921FB54442D18) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rxy(i64 %20, double 0x400921FB54442D18, double 0xBFE921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FE921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %29, double 0x400921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rzz(i64 %26, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rzz(i64 %23, i64 %29, double 0x3FF921FB54442D18) - tail call void @___rxy(i64 %29, double 0xC002D97C7F3321D2, double 0x400921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0x3FE921FB54442D18) - tail call void @___rzz(i64 %23, i64 %26, double 0x3FE921FB54442D18) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0xBFE921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FE921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_470.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_470.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.i.i - -cond_exit_470.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_470.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_470.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.1.i.i - -cond_exit_470.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_470.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_470.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_470.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_470.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_470.thread.2.i.i - -cond_exit_470.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_470.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_470.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_405.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_405 + +cond_exit_405: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_405.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_405 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_405.1 + +cond_exit_405.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_405 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_405.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_405.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_405.2 + +cond_exit_405.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_405.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_470.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_405, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_405.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -476,22 +456,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-apple-darwin.ll index e5562d0f..35784a36 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-apple-darwin.ll @@ -5,474 +5,454 @@ target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-unknown-linux-gnu.ll index a1c2c045..6e546134 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-aarch64-unknown-linux-gnu.ll @@ -5,474 +5,454 @@ target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-apple-darwin.ll index 1ebc7316..e135786c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-apple-darwin.ll @@ -5,474 +5,454 @@ target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-unknown-linux-gnu.ll index 97476699..99a310d4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-unknown-linux-gnu.ll @@ -5,474 +5,454 @@ target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-windows-gnu.ll index 858c6716..0da6e542 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_guppy/test_sim_restriction/nonclifford-sol-x86_64-windows-gnu.ll @@ -5,474 +5,454 @@ target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_cs.46C3C4B5.0 = private constant [16 x i8] c"\0FUSER:BOOLARR:cs" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 24) + %0 = tail call ptr @heap_alloc(i64 3) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 24) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit + br i1 %not_max.not.not.i, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit -cond_449_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_361_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.422.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.357.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.422.exit.1, %__hugr__.__tk2_sol_qalloc.422.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.357.exit.1, %__hugr__.__tk2_sol_qalloc.357.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_449_case_0.i, label %__hugr__.__tk2_sol_qalloc.422.exit.1 + br i1 %not_max.not.not.i.1, label %cond_361_case_0.i, label %__hugr__.__tk2_sol_qalloc.357.exit.1 -__hugr__.__tk2_sol_qalloc.422.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.357.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not228 = icmp eq i64 %6, 0 - br i1 %.not228, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.422.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not902 = icmp eq i64 %10, 0 + br i1 %.not902, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.357.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_449_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_361_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not229 = icmp eq i64 %10, 0 - br i1 %.not229, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i179, label %__barray_mask_borrow.exit - -panic.i179: ; preds = %cond_exit_20.2 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %16, double 0x400921FB54442D18) - %17 = load i64, ptr %1, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not903 = icmp eq i64 %14, 0 + br i1 %.not903, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit181, label %panic.i180 + br i1 %18, label %panic.i833, label %__barray_mask_borrow.exit -panic.i180: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +panic.i833: ; preds = %cond_exit_12.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_return.exit181: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = trunc i64 %20 to i1 - br i1 %21, label %panic.i182, label %__barray_mask_borrow.exit183 - -panic.i182: ; preds = %__barray_mask_return.exit181 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %19 = or disjoint i64 %17, 1 + store i64 %19, ptr %5, align 4 + %20 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x400921FB54442D18) + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 2 + %.not = icmp eq i64 %22, 0 + br i1 %.not, label %__barray_mask_borrow.exit835, label %panic.i834 + +panic.i834: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit183: ; preds = %__barray_mask_return.exit181 - %22 = or disjoint i64 %20, 1 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %0, align 4 - %24 = and i64 %20, 2 - %.not = icmp eq i64 %24, 0 - br i1 %.not, label %__barray_mask_borrow.exit185, label %panic.i184 +__barray_mask_borrow.exit835: ; preds = %__barray_mask_borrow.exit + %23 = or disjoint i64 %21, 2 + store i64 %23, ptr %5, align 4 + %24 = load i64, ptr %12, align 4 + %25 = and i64 %21, 4 + %.not896 = icmp eq i64 %25, 0 + br i1 %.not896, label %__barray_mask_borrow.exit837, label %panic.i836 -panic.i184: ; preds = %__barray_mask_borrow.exit183 +panic.i836: ; preds = %__barray_mask_borrow.exit835 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit185: ; preds = %__barray_mask_borrow.exit183 - %25 = or disjoint i64 %20, 3 - store i64 %25, ptr %1, align 4 - %26 = load i64, ptr %8, align 4 - %27 = and i64 %20, 4 - %.not213 = icmp eq i64 %27, 0 - br i1 %.not213, label %__barray_mask_borrow.exit187, label %panic.i186 - -panic.i186: ; preds = %__barray_mask_borrow.exit185 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_mask_borrow.exit837: ; preds = %__barray_mask_borrow.exit835 + %26 = or disjoint i64 %21, 6 + store i64 %26, ptr %5, align 4 + %27 = load i64, ptr %16, align 4 + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %24, double 0xC002D97C7F3321D2) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) + tail call void @___rz(i64 %20, double 0xC002D97C7F3321D2) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rp(i64 %20, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %20, i64 %24, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %24, i64 %27, double 0x3FE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x400921FB54442D18) + tail call void @___rpp(i64 %20, i64 %27, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %27, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %27, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %24, i64 %27, double 0xBFE921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %24, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %24, double 0x400921FB54442D18) + tail call void @___rp(i64 %20, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %20, double 0x3FF921FB54442D18) + %28 = load i64, ptr %5, align 4 + %29 = trunc i64 %28 to i1 + br i1 %29, label %__barray_mask_return.exit839, label %panic.i838 + +panic.i838: ; preds = %__barray_mask_borrow.exit837 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit187: ; preds = %__barray_mask_borrow.exit185 - %28 = or disjoint i64 %20, 7 - store i64 %28, ptr %1, align 4 - %29 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %26, double 0xC002D97C7F3321D2) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xC002D97C7F3321D2) - tail call void @___rz(i64 %23, double 0xC002D97C7F3321D2) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FE921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rp(i64 %23, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %23, i64 %26, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rpp(i64 %26, i64 %29, double 0x3FE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x400921FB54442D18) - tail call void @___rpp(i64 %23, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %29, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %29, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %26, i64 %29, double 0xBFE921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %26, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %26, double 0x400921FB54442D18) - tail call void @___rp(i64 %23, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %23, double 0x3FF921FB54442D18) - %30 = load i64, ptr %1, align 4 - %31 = trunc i64 %30 to i1 - br i1 %31, label %__barray_mask_return.exit189, label %panic.i188 - -panic.i188: ; preds = %__barray_mask_borrow.exit187 +__barray_mask_return.exit839: ; preds = %__barray_mask_borrow.exit837 + %30 = and i64 %28, -2 + store i64 %30, ptr %5, align 4 + store i64 %20, ptr %4, align 4 + %31 = load i64, ptr %5, align 4 + %32 = and i64 %31, 2 + %.not897 = icmp eq i64 %32, 0 + br i1 %.not897, label %panic.i840, label %__barray_mask_return.exit841 + +panic.i840: ; preds = %__barray_mask_return.exit839 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit189: ; preds = %__barray_mask_borrow.exit187 - %32 = and i64 %30, -2 - store i64 %32, ptr %1, align 4 - store i64 %23, ptr %0, align 4 - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 2 - %.not214 = icmp eq i64 %34, 0 - br i1 %.not214, label %panic.i190, label %__barray_mask_return.exit191 +__barray_mask_return.exit841: ; preds = %__barray_mask_return.exit839 + %33 = and i64 %31, -3 + store i64 %33, ptr %5, align 4 + store i64 %24, ptr %12, align 4 + %34 = load i64, ptr %5, align 4 + %35 = and i64 %34, 4 + %.not898 = icmp eq i64 %35, 0 + br i1 %.not898, label %panic.i842, label %__barray_mask_return.exit843 -panic.i190: ; preds = %__barray_mask_return.exit189 +panic.i842: ; preds = %__barray_mask_return.exit841 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit191: ; preds = %__barray_mask_return.exit189 - %35 = and i64 %33, -3 - store i64 %35, ptr %1, align 4 - store i64 %26, ptr %8, align 4 - %36 = load i64, ptr %1, align 4 - %37 = and i64 %36, 4 - %.not215 = icmp eq i64 %37, 0 - br i1 %.not215, label %panic.i192, label %__barray_mask_return.exit193 +__barray_mask_return.exit843: ; preds = %__barray_mask_return.exit841 + %36 = and i64 %34, -5 + store i64 %36, ptr %5, align 4 + store i64 %27, ptr %16, align 4 + %37 = load i64, ptr %5, align 4 + %38 = trunc i64 %37 to i1 + br i1 %38, label %panic.i850, label %.thread -panic.i192: ; preds = %__barray_mask_return.exit191 +panic.i846: ; preds = %.thread.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit193: ; preds = %__barray_mask_return.exit191 - %38 = and i64 %36, -5 - store i64 %38, ptr %1, align 4 - store i64 %29, ptr %12, align 4 - %39 = tail call ptr @heap_alloc(i64 24) - %40 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %40, align 1 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.145.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %43 = tail call ptr @heap_alloc(i64 3) - %44 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %44, align 1 - %45 = load i64, ptr %40, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %panic.i.i.i208, label %__barray_check_bounds.exit221.i.i - -mask_block_err.i.i.i: ; preds = %loop_body.2.i +mask_block_err.i: ; preds = %cond_exit_137.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit193 +panic.i850: ; preds = %cond_exit_137.1, %cond_exit_137, %__barray_mask_return.exit843 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i": ; preds = %__barray_mask_return.exit193 - %47 = or disjoint i64 %41, 1 - store i64 %47, ptr %1, align 4 - %48 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %48) +.thread: ; preds = %__barray_mask_return.exit843 + %39 = or disjoint i64 %37, 1 + store i64 %39, ptr %5, align 4 + %40 = load i64, ptr %4, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %40) + tail call void @___qfree(i64 %40) + %41 = load i64, ptr %3, align 4 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_137, label %panic.i846 + +cond_exit_137: ; preds = %.thread + %43 = and i64 %41, -2 + store i64 %43, ptr %3, align 4 + store i64 %lazy_measure, ptr %2, align 4 + %44 = load i64, ptr %5, align 4 + %45 = and i64 %44, 2 + %.not916 = icmp eq i64 %45, 0 + br i1 %.not916, label %.thread.1, label %panic.i850 + +.thread.1: ; preds = %cond_exit_137 + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %5, align 4 + %47 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %48 = load i64, ptr %47, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) tail call void @___qfree(i64 %48) - %49 = load i64, ptr %40, align 4 - %50 = trunc i64 %49 to i1 - br i1 %50, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.i" - %51 = and i64 %49, -2 - store i64 %51, ptr %40, align 4 - store i64 %lazy_measure.i, ptr %39, align 4 - %52 = load i64, ptr %1, align 4 - %53 = and i64 %52, 2 - %.not216 = icmp eq i64 %53, 0 - br i1 %.not216, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i": ; preds = %loop_body.i - %54 = or disjoint i64 %52, 2 - store i64 %54, ptr %1, align 4 - %55 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %55) - tail call void @___qfree(i64 %55) - %56 = load i64, ptr %40, align 4 - %57 = and i64 %56, 2 - %.not.i = icmp eq i64 %57, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.302.exit.thread.1.i" - %58 = and i64 %56, -3 - store i64 %58, ptr %40, align 4 - %59 = getelementptr inbounds nuw i8, ptr %39, i64 8 - store i64 %lazy_measure.1.i, ptr %59, align 4 - %60 = load i64, ptr %1, align 4 - %61 = and i64 %60, 4 - %.not217 = icmp eq i64 %61, 0 - br i1 %.not217, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %62 = or disjoint i64 %60, 4 - store i64 %62, ptr %1, align 4 - %63 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %63) - tail call void @___qfree(i64 %63) - %64 = load i64, ptr %40, align 4 - %65 = and i64 %64, 4 - %.not182.i = icmp eq i64 %65, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %66 = and i64 %64, -5 - store i64 %66, ptr %40, align 4 - %67 = getelementptr inbounds nuw i8, ptr %39, i64 16 - store i64 %lazy_measure.2.i, ptr %67, align 4 - %68 = load i64, ptr %1, align 4 - %69 = or i64 %68, -8 - store i64 %69, ptr %1, align 4 - %70 = icmp eq i64 %69, -1 - br i1 %70, label %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit", label %mask_block_err.i.i.i - -panic.i.i.i208: ; preds = %__barray_check_bounds.exit.i.2.i197, %loop_body.i195, %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" + %49 = load i64, ptr %3, align 4 + %50 = and i64 %49, 2 + %.not917 = icmp eq i64 %50, 0 + br i1 %.not917, label %panic.i846, label %cond_exit_137.1 + +cond_exit_137.1: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %3, align 4 + %52 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %5, align 4 + %54 = and i64 %53, 4 + %.not918 = icmp eq i64 %54, 0 + br i1 %.not918, label %.thread.2, label %panic.i850 + +.thread.2: ; preds = %cond_exit_137.1 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %5, align 4 + %56 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %57 = load i64, ptr %56, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %57) + tail call void @___qfree(i64 %57) + %58 = load i64, ptr %3, align 4 + %59 = and i64 %58, 4 + %.not919 = icmp eq i64 %59, 0 + br i1 %.not919, label %panic.i846, label %cond_exit_137.2 + +cond_exit_137.2: ; preds = %.thread.2 + %60 = and i64 %58, -5 + store i64 %60, ptr %3, align 4 + %61 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %lazy_measure.2, ptr %61, align 4 + %62 = load i64, ptr %5, align 4 + %63 = or i64 %62, -8 + store i64 %63, ptr %5, align 4 + %64 = icmp eq i64 %63, -1 + br i1 %64, label %loop_body296.preheader.preheader, label %mask_block_err.i + +loop_body296.preheader.preheader: ; preds = %cond_exit_137.2 + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + %65 = load i64, ptr %3, align 4 + %66 = trunc i64 %65 to i1 + br i1 %66, label %panic.i854, label %__barray_check_bounds.exit857 + +panic.i854: ; preds = %__barray_check_bounds.exit853.2, %cond_exit_203, %loop_body296.preheader.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.145.exit" - %71 = or disjoint i64 %45, 1 - store i64 %71, ptr %40, align 4 - %72 = load i64, ptr %39, align 4 - tail call void @___inc_future_refcount(i64 %72) - %73 = load i64, ptr %40, align 4 - %74 = trunc i64 %73 to i1 - br i1 %74, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i", label %panic.i222.i.i +__barray_check_bounds.exit857: ; preds = %loop_body296.preheader.preheader + %67 = or disjoint i64 %65, 1 + store i64 %67, ptr %3, align 4 + %68 = load i64, ptr %2, align 4 + tail call void @___inc_future_refcount(i64 %68) + %69 = load i64, ptr %3, align 4 + %70 = trunc i64 %69 to i1 + br i1 %70, label %cond_244_case_1.thread, label %panic.i858 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.2.i, %__barray_check_bounds.exit221.i.1.i, %__barray_check_bounds.exit221.i.i +panic.i858: ; preds = %__barray_check_bounds.exit857.2, %__barray_check_bounds.exit857.1, %__barray_check_bounds.exit857 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i": ; preds = %__barray_check_bounds.exit221.i.i - %75 = and i64 %73, -2 - store i64 %75, ptr %40, align 4 - store i64 %72, ptr %39, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %72) - tail call void @___dec_future_refcount(i64 %72) - %76 = load i64, ptr %44, align 4 - %77 = trunc i64 %76 to i1 - br i1 %77, label %loop_body.i195, label %panic.i.i194 - -"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit": ; preds = %cond_exit_472.thread.2.i.i - tail call void @heap_free(ptr nonnull %39) - tail call void @heap_free(ptr nonnull %40) - %78 = load i64, ptr %44, align 4 - %79 = and i64 %78, 7 - store i64 %79, ptr %44, align 4 - %80 = icmp eq i64 %79, 0 - br i1 %80, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i.i.i203: ; preds = %cond_exit_472.thread.2.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i862: ; preds = %__barray_check_bounds.exit861.2, %cond_244_case_1.thread.1, %cond_244_case_1.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.2.i199 - %81 = or disjoint i64 %117, 1 - store i64 %81, ptr %40, align 4 - %82 = load i64, ptr %39, align 4 - tail call void @___dec_future_refcount(i64 %82) - %.pre = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.i.i - -cond_exit_472.thread.i.i: ; preds = %loop_body.2.i199, %__barray_mask_borrow.exit228.i.i - %83 = phi i64 [ %117, %loop_body.2.i199 ], [ %.pre, %__barray_mask_borrow.exit228.i.i ] - %84 = and i64 %83, 2 - %.not222 = icmp eq i64 %84, 0 - br i1 %.not222, label %__barray_mask_borrow.exit228.1.i.i, label %cond_exit_472.thread.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_472.thread.i.i - %85 = or disjoint i64 %83, 2 - store i64 %85, ptr %40, align 4 - %86 = load i64, ptr %59, align 4 - tail call void @___dec_future_refcount(i64 %86) - %.pre226 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.1.i.i - -cond_exit_472.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_472.thread.i.i - %87 = phi i64 [ %.pre226, %__barray_mask_borrow.exit228.1.i.i ], [ %83, %cond_exit_472.thread.i.i ] - %88 = and i64 %87, 4 - %.not223 = icmp eq i64 %88, 0 - br i1 %.not223, label %__barray_mask_borrow.exit228.2.i.i, label %cond_exit_472.thread.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_472.thread.1.i.i - %89 = or disjoint i64 %87, 4 - store i64 %89, ptr %40, align 4 - %90 = load i64, ptr %67, align 4 - tail call void @___dec_future_refcount(i64 %90) - %.pre227 = load i64, ptr %40, align 4 - br label %cond_exit_472.thread.2.i.i - -cond_exit_472.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_472.thread.1.i.i - %91 = phi i64 [ %.pre227, %__barray_mask_borrow.exit228.2.i.i ], [ %87, %cond_exit_472.thread.1.i.i ] - %92 = or i64 %91, -8 - store i64 %92, ptr %40, align 4 - %93 = icmp eq i64 %92, -1 - br i1 %93, label %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit", label %mask_block_err.i.i.i203 - -panic.i.i194: ; preds = %__barray_check_bounds.exit.2.i198, %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +cond_244_case_1.thread: ; preds = %__barray_check_bounds.exit857 + %71 = and i64 %69, -2 + store i64 %71, ptr %3, align 4 + store i64 %68, ptr %2, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %68) + tail call void @___dec_future_refcount(i64 %68) + %72 = load i64, ptr %1, align 4 + %73 = trunc i64 %72 to i1 + br i1 %73, label %cond_exit_203, label %panic.i862 + +mask_block_err.i867: ; preds = %cond_exit_407.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -loop_body.i195: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.i" - %94 = and i64 %76, -2 - store i64 %94, ptr %44, align 4 - store i1 %read_bool.i, ptr %43, align 1 - %95 = load i64, ptr %40, align 4 +__barray_mask_borrow.exit875: ; preds = %cond_exit_203.2 + %74 = or disjoint i64 %114, 1 + store i64 %74, ptr %3, align 4 + %75 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %75) + br label %cond_exit_407 + +cond_exit_407: ; preds = %__barray_mask_borrow.exit875, %cond_exit_203.2 + %76 = load i64, ptr %3, align 4 + %77 = and i64 %76, 2 + %.not920 = icmp eq i64 %77, 0 + br i1 %.not920, label %__barray_mask_borrow.exit875.1, label %cond_exit_407.1 + +__barray_mask_borrow.exit875.1: ; preds = %cond_exit_407 + %78 = or disjoint i64 %76, 2 + store i64 %78, ptr %3, align 4 + %79 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %80 = load i64, ptr %79, align 4 + tail call void @___dec_future_refcount(i64 %80) + br label %cond_exit_407.1 + +cond_exit_407.1: ; preds = %__barray_mask_borrow.exit875.1, %cond_exit_407 + %81 = load i64, ptr %3, align 4 + %82 = and i64 %81, 4 + %.not921 = icmp eq i64 %82, 0 + br i1 %.not921, label %__barray_mask_borrow.exit875.2, label %cond_exit_407.2 + +__barray_mask_borrow.exit875.2: ; preds = %cond_exit_407.1 + %83 = or disjoint i64 %81, 4 + store i64 %83, ptr %3, align 4 + %84 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %85 = load i64, ptr %84, align 4 + tail call void @___dec_future_refcount(i64 %85) + br label %cond_exit_407.2 + +cond_exit_407.2: ; preds = %__barray_mask_borrow.exit875.2, %cond_exit_407.1 + %86 = load i64, ptr %3, align 4 + %87 = or i64 %86, -8 + store i64 %87, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + br i1 %88, label %loop_out295, label %mask_block_err.i867 + +cond_exit_203: ; preds = %cond_244_case_1.thread + %89 = and i64 %72, -2 + store i64 %89, ptr %1, align 4 + store i1 %read_bool, ptr %0, align 1 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 2 + %.not904 = icmp eq i64 %91, 0 + br i1 %.not904, label %__barray_check_bounds.exit857.1, label %panic.i854 + +__barray_check_bounds.exit857.1: ; preds = %cond_exit_203 + %92 = or disjoint i64 %90, 2 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %94 = load i64, ptr %93, align 4 + tail call void @___inc_future_refcount(i64 %94) + %95 = load i64, ptr %3, align 4 %96 = and i64 %95, 2 - %.not218 = icmp eq i64 %96, 0 - br i1 %.not218, label %__barray_check_bounds.exit221.i.1.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.1.i: ; preds = %loop_body.i195 - %97 = or disjoint i64 %95, 2 - store i64 %97, ptr %40, align 4 - %98 = load i64, ptr %59, align 4 - tail call void @___inc_future_refcount(i64 %98) - %99 = load i64, ptr %40, align 4 - %100 = and i64 %99, 2 - %.not219 = icmp eq i64 %100, 0 - br i1 %.not219, label %panic.i222.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - -"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i": ; preds = %__barray_check_bounds.exit221.i.1.i - %101 = and i64 %99, -3 - store i64 %101, ptr %40, align 4 - store i64 %98, ptr %59, align 4 - %read_bool.1.i = tail call i1 @___read_future_bool(i64 %98) - tail call void @___dec_future_refcount(i64 %98) - %102 = load i64, ptr %44, align 4 - %103 = and i64 %102, 2 - %.not.i196 = icmp eq i64 %103, 0 - br i1 %.not.i196, label %panic.i.i194, label %__barray_check_bounds.exit.i.2.i197 - -__barray_check_bounds.exit.i.2.i197: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$Measurement&3.239.exit.thread.1.i" - %104 = and i64 %102, -3 - store i64 %104, ptr %44, align 4 - %105 = getelementptr inbounds nuw i8, ptr %43, i64 1 - store i1 %read_bool.1.i, ptr %105, align 1 - %106 = load i64, ptr %40, align 4 - %107 = and i64 %106, 4 - %.not220 = icmp eq i64 %107, 0 - br i1 %.not220, label %__barray_check_bounds.exit221.i.2.i, label %panic.i.i.i208 - -__barray_check_bounds.exit221.i.2.i: ; preds = %__barray_check_bounds.exit.i.2.i197 - %108 = or disjoint i64 %106, 4 - store i64 %108, ptr %40, align 4 - %109 = load i64, ptr %67, align 4 - tail call void @___inc_future_refcount(i64 %109) - %110 = load i64, ptr %40, align 4 + %.not905 = icmp eq i64 %96, 0 + br i1 %.not905, label %panic.i858, label %cond_244_case_1.thread.1 + +cond_244_case_1.thread.1: ; preds = %__barray_check_bounds.exit857.1 + %97 = and i64 %95, -3 + store i64 %97, ptr %3, align 4 + store i64 %94, ptr %93, align 4 + %read_bool.1 = tail call i1 @___read_future_bool(i64 %94) + tail call void @___dec_future_refcount(i64 %94) + %98 = load i64, ptr %1, align 4 + %99 = and i64 %98, 2 + %.not906 = icmp eq i64 %99, 0 + br i1 %.not906, label %panic.i862, label %__barray_check_bounds.exit853.2 + +__barray_check_bounds.exit853.2: ; preds = %cond_244_case_1.thread.1 + %100 = and i64 %98, -3 + store i64 %100, ptr %1, align 4 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 1 + store i1 %read_bool.1, ptr %101, align 1 + %102 = load i64, ptr %3, align 4 + %103 = and i64 %102, 4 + %.not907 = icmp eq i64 %103, 0 + br i1 %.not907, label %__barray_check_bounds.exit857.2, label %panic.i854 + +__barray_check_bounds.exit857.2: ; preds = %__barray_check_bounds.exit853.2 + %104 = or disjoint i64 %102, 4 + store i64 %104, ptr %3, align 4 + %105 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %106 = load i64, ptr %105, align 4 + tail call void @___inc_future_refcount(i64 %106) + %107 = load i64, ptr %3, align 4 + %108 = and i64 %107, 4 + %.not908 = icmp eq i64 %108, 0 + br i1 %.not908, label %panic.i858, label %__barray_check_bounds.exit861.2 + +__barray_check_bounds.exit861.2: ; preds = %__barray_check_bounds.exit857.2 + %109 = and i64 %107, -5 + store i64 %109, ptr %3, align 4 + store i64 %106, ptr %105, align 4 + %read_bool.2 = tail call i1 @___read_future_bool(i64 %106) + tail call void @___dec_future_refcount(i64 %106) + %110 = load i64, ptr %1, align 4 %111 = and i64 %110, 4 - %.not221 = icmp eq i64 %111, 0 - br i1 %.not221, label %panic.i222.i.i, label %__barray_check_bounds.exit.2.i198 + %.not909 = icmp eq i64 %111, 0 + br i1 %.not909, label %panic.i862, label %cond_exit_203.2 -__barray_check_bounds.exit.2.i198: ; preds = %__barray_check_bounds.exit221.i.2.i +cond_exit_203.2: ; preds = %__barray_check_bounds.exit861.2 %112 = and i64 %110, -5 - store i64 %112, ptr %40, align 4 - store i64 %109, ptr %67, align 4 - %read_bool.2.i = tail call i1 @___read_future_bool(i64 %109) - tail call void @___dec_future_refcount(i64 %109) - %113 = load i64, ptr %44, align 4 - %114 = and i64 %113, 4 - %.not169.i = icmp eq i64 %114, 0 - br i1 %.not169.i, label %panic.i.i194, label %loop_body.2.i199 - -loop_body.2.i199: ; preds = %__barray_check_bounds.exit.2.i198 - %115 = and i64 %113, -5 - store i64 %115, ptr %44, align 4 - %116 = getelementptr inbounds nuw i8, ptr %43, i64 2 - store i1 %read_bool.2.i, ptr %116, align 1 - %117 = load i64, ptr %40, align 4 - %118 = trunc i64 %117 to i1 - br i1 %118, label %cond_exit_472.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" + store i64 %112, ptr %1, align 4 + %113 = getelementptr inbounds nuw i8, ptr %0, i64 2 + store i1 %read_bool.2, ptr %113, align 1 + %114 = load i64, ptr %3, align 4 + %115 = trunc i64 %114 to i1 + br i1 %115, label %cond_exit_407, label %__barray_mask_borrow.exit875 + +loop_out295: ; preds = %cond_exit_407.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %116 = load i64, ptr %1, align 4 + %117 = and i64 %116, 7 + store i64 %117, ptr %1, align 4 + %118 = icmp eq i64 %117, 0 + br i1 %118, label %__barray_check_none_borrowed.exit, label %mask_block_err.i876 + +mask_block_err.i876: ; preds = %loop_out295 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$3.186.exit" +__barray_check_none_borrowed.exit: ; preds = %loop_out295 %119 = tail call ptr @heap_alloc(i64 3) %120 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %120, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %43, i64 3, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %119, ptr noundef nonnull align 1 dereferenceable(3) %0, i64 3, i1 false) tail call void @heap_free(ptr nonnull %119) - %121 = load i64, ptr %44, align 4 + %121 = load i64, ptr %1, align 4 %122 = and i64 %121, 7 - store i64 %122, ptr %44, align 4 + store i64 %122, ptr %1, align 4 %123 = icmp eq i64 %122, 0 - br i1 %123, label %__barray_check_none_borrowed.exit210, label %mask_block_err.i209 + br i1 %123, label %__barray_check_none_borrowed.exit880, label %mask_block_err.i878 -mask_block_err.i209: ; preds = %__barray_check_none_borrowed.exit +mask_block_err.i878: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit210: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit880: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %124 = alloca [3 x i1], align 1 store i1 false, ptr %124, align 1 - %.repack177 = getelementptr inbounds nuw i8, ptr %124, i64 1 - store i1 false, ptr %.repack177, align 1 - %.repack178 = getelementptr inbounds nuw i8, ptr %124, i64 2 - store i1 false, ptr %.repack178, align 1 + %.repack831 = getelementptr inbounds nuw i8, ptr %124, i64 1 + store i1 false, ptr %.repack831, align 1 + %.repack832 = getelementptr inbounds nuw i8, ptr %124, i64 2 + store i1 false, ptr %.repack832, align 1 store i32 3, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %43, ptr %arr_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 store ptr %124, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_cs.46C3C4B5.0, i64 15, ptr nonnull %out_arr_alloca) ret void @@ -483,22 +463,22 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-aarch64-apple-darwin.ll index d1736dbe..87a3e3ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-aarch64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll index 0f75f45e..543974ce 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-apple-darwin.ll index 22b404d0..24b07b05 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll index 97d09e9e..b157879a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-windows-gnu.ll index 2f0bcf20..0927b25a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-helios-x86_64-windows-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-aarch64-apple-darwin.ll index 82d7408b..171b9d3f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-aarch64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll index e9a0dc5b..dedf1307 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-apple-darwin.ll index 1e9f8331..4b61b220 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll index f166e08d..ab91d76e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-windows-gnu.ll index 695d3dd9..22d0cd4c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state-sol-x86_64-windows-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[QuestPlugin]/array_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-aarch64-apple-darwin.ll index d1736dbe..87a3e3ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-aarch64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll index 0f75f45e..543974ce 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-aarch64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-apple-darwin.ll index 22b404d0..24b07b05 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll index 97d09e9e..b157879a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-windows-gnu.ll index 2f0bcf20..0927b25a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-helios-x86_64-windows-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_helios_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-aarch64-apple-darwin.ll index 82d7408b..171b9d3f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-aarch64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll index e9a0dc5b..dedf1307 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-aarch64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-apple-darwin.ll index 1e9f8331..4b61b220 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-apple-darwin.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll index f166e08d..ab91d76e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[QuestPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-unknown-linux-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-windows-gnu.ll index 695d3dd9..22d0cd4c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state-sol-x86_64-windows-gnu.ll @@ -4,118 +4,119 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_307_case_0.i, label %__hugr__.__tk2_sol_qalloc.303.exit + br i1 %not_max.not.not.i, label %cond_398_case_0.i, label %__barray_check_bounds.exit -cond_307_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_398_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.303.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.303.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.303.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_307_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_398_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i318, label %__barray_check_bounds.exit320 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i528, label %__barray_check_bounds.exit530 -panic.i318: ; preds = %__barray_check_bounds.exit317.1, %cond_exit_20.1 +panic.i528: ; preds = %__barray_check_bounds.exit527.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit320: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit317.1, label %panic.i321 +__barray_check_bounds.exit530: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit527.1, label %panic.i531 -panic.i321: ; preds = %__barray_check_bounds.exit320.1, %__barray_check_bounds.exit320 +panic.i531: ; preds = %__barray_check_bounds.exit530.1, %__barray_check_bounds.exit530 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit317.1: ; preds = %__barray_check_bounds.exit320 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not338 = icmp eq i64 %17, 0 - br i1 %.not338, label %__barray_check_bounds.exit320.1, label %panic.i318 - -__barray_check_bounds.exit320.1: ; preds = %__barray_check_bounds.exit317.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit527.1: ; preds = %__barray_check_bounds.exit530 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not534 = icmp eq i64 %16, 0 + br i1 %.not534, label %__barray_check_bounds.exit530.1, label %panic.i528 + +__barray_check_bounds.exit530.1: ; preds = %__barray_check_bounds.exit527.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not339 = icmp eq i64 %21, 0 - br i1 %.not339, label %panic.i321, label %__barray_mask_return.exit322.1 + %.not535 = icmp eq i64 %21, 0 + br i1 %.not535, label %panic.i531, label %__barray_mask_return.exit532.1 -__barray_mask_return.exit322.1: ; preds = %__barray_check_bounds.exit320.1 +__barray_mask_return.exit532.1: ; preds = %__barray_check_bounds.exit530.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = and i64 %23, 3 store i64 %24, ptr %1, align 4 %25 = icmp eq i64 %24, 0 br i1 %25, label %__barray_check_bounds.exit.1.i, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_return.exit322.1 +mask_block_err.i: ; preds = %__barray_mask_return.exit532.1 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit322.1 +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_return.exit532.1 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %26 = alloca [2 x i1], align 1 store i1 false, ptr %26, align 1 - %.repack309 = getelementptr inbounds nuw i8, ptr %26, i64 1 - store i1 false, ptr %.repack309, align 1 + %.repack525 = getelementptr inbounds nuw i8, ptr %26, i64 1 + store i1 false, ptr %.repack525, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -128,28 +129,28 @@ __barray_check_bounds.exit.1.i: ; preds = %__barray_mask_retur %29 = load i64, ptr %27, align 4 %30 = and i64 %29, 2 %.not.i = icmp eq i64 %30, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_222.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_268.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %31 = or disjoint i64 %29, 2 store i64 %31, ptr %27, align 4 - %32 = load i64, ptr %8, align 4 + %32 = load i64, ptr %18, align 4 call void @___qfree(i64 %32) %.pre.i = load i64, ptr %27, align 4 - br label %cond_exit_222.i + br label %cond_exit_268.1.i -cond_exit_222.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_268.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %33 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %29, %__barray_check_bounds.exit.1.i ] %34 = or i64 %33, -4 store i64 %34, ptr %27, align 4 %35 = icmp eq i64 %34, -1 - br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.180.exit", label %mask_block_err.i.i + br i1 %35, label %"__hugr__.guppylang.std.quantum.discard_array$2.222.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_222.i +mask_block_err.i.i: ; preds = %cond_exit_268.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -"__hugr__.guppylang.std.quantum.discard_array$2.180.exit": ; preds = %cond_exit_222.i +"__hugr__.guppylang.std.quantum.discard_array$2.222.exit": ; preds = %cond_exit_268.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %27) ret void @@ -162,10 +163,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_state[StimPlugin]/array_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_state[StimPlugin]/array_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll index 36370258..74152399 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll index d85e357c..7c64f725 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll index 15a4ba8f..a177c3cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll index fc22bdd5..90c3f63a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll index aa0155f7..6b8ed3f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll index c8ac497d..cecbb60d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll index cf3b49f1..b1f9614f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll index c3165a5c..2f697906 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll index 024feee5..6095c528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll index bc9b9d7d..ef8d77b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[QuestPlugin]/array_subscript_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll index 36370258..74152399 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll index d85e357c..7c64f725 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll index 15a4ba8f..a177c3cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll index fc22bdd5..90c3f63a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll index aa0155f7..6b8ed3f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-helios-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll index c8ac497d..cecbb60d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll index cf3b49f1..b1f9614f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll index c3165a5c..2f697906 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll index 024feee5..6095c528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[QuestPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll index bc9b9d7d..ef8d77b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state-sol-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_array_subscript_state[StimPlugin]/array_subscript_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_array_subscript_state[StimPlugin]/array_subscript_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-apple-darwin.ll index ef9e999e..32da74f2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll index d68dd704..2457afb9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-apple-darwin.ll index e30095c1..8751a8a2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll index 73bfc94f..c318b96b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-windows-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-windows-gnu.ll index 89fa8914..2081a7ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-apple-darwin.ll index 6ecac946..b99a0419 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll index 643bac72..81f78686 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-apple-darwin.ll index 2d603a81..d90699a9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll index be0e3a94..eb169442 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-windows-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-windows-gnu.ll index 10f05813..99c86bdb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[QuestPlugin]/initial_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-aarch64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-aarch64-apple-darwin.ll index ef9e999e..32da74f2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll index d68dd704..2457afb9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-apple-darwin.ll index e30095c1..8751a8a2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll index 73bfc94f..c318b96b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-windows-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-windows-gnu.ll index 89fa8914..2081a7ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-helios-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_helios_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_helios_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-aarch64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-aarch64-apple-darwin.ll index 6ecac946..b99a0419 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll index 643bac72..81f78686 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-apple-darwin.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-apple-darwin.ll index 2d603a81..d90699a9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll index be0e3a94..eb169442 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[QuestPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-windows-gnu.ll similarity index 90% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-windows-gnu.ll index 10f05813..99c86bdb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state-sol-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit + br i1 %not_max.not.not.i, label %cond_15_case_0.i, label %__hugr__.__tk2_sol_qalloc.11.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_15_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.11.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %0 = tail call ptr @heap_alloc(i64 8) %1 = tail call ptr @heap_alloc(i64 8) @@ -29,11 +29,11 @@ __hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block %4 = icmp eq i64 %3, 0 br i1 %4, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.19.exit +__barray_mask_check_not_borrowed.exit: ; preds = %__hugr__.__tk2_sol_qalloc.11.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_initial_state[StimPlugin]/initial_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_initial_state[StimPlugin]/initial_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll index db51a33c..c9b701ab 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll index 2ac6eef1..2dac175d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll index 020b3f16..32d86400 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll index d90b7b1f..063445e1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll index c9d4dcf5..91b13668 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll index 2f724be3..f834a8d4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll index 5b6bce16..cc3bc0ac 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll index c2ad144c..3f4785e4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll index b32d935f..f28a7b6f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll index 33c9b41c..1b77d112 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll index db51a33c..c9b701ab 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll index 2ac6eef1..2dac175d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll index 020b3f16..32d86400 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll index d90b7b1f..063445e1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll index c9d4dcf5..91b13668 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll index 2f724be3..f834a8d4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll index 5b6bce16..cc3bc0ac 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll index c2ad144c..3f4785e4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll index b32d935f..f28a7b6f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll index 33c9b41c..1b77d112 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll index db51a33c..c9b701ab 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll index 2ac6eef1..2dac175d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll index 020b3f16..32d86400 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll index d90b7b1f..063445e1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll index c9d4dcf5..91b13668 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll index 2f724be3..f834a8d4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll index 5b6bce16..cc3bc0ac 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll index c2ad144c..3f4785e4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll index b32d935f..f28a7b6f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll index 33c9b41c..1b77d112 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-QuestPlugin]/quantum_replay_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll index db51a33c..c9b701ab 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll index 2ac6eef1..2dac175d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-aarch64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll index 020b3f16..32d86400 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-apple-darwin.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll index d90b7b1f..063445e1 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-unknown-linux-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll similarity index 82% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll index c9d4dcf5..91b13668 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-QuestPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-helios-x86_64-windows-gnu.ll @@ -14,56 +14,56 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_helios_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_helios_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) - tail call void @___rxy(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.24.exit101: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) + tail call void @___rxy(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i100, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i98, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_helios_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll index 2f724be3..f834a8d4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll index 5b6bce16..cc3bc0ac 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-aarch64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll index c2ad144c..3f4785e4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-apple-darwin.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll index b32d935f..f28a7b6f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-unknown-linux-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll similarity index 84% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll index 33c9b41c..1b77d112 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[0-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state-sol-x86_64-windows-gnu.ll @@ -14,29 +14,29 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_28_case_0.i, label %__hugr__.__tk2_sol_qalloc.24.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_28_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.24.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i100 = tail call i64 @___qalloc() - %not_max.not.not.i101 = icmp eq i64 %qalloc.i100, -1 - br i1 %not_max.not.not.i101, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i98 = tail call i64 @___qalloc() + %not_max.not.not.i99 = icmp eq i64 %qalloc.i98, -1 + br i1 %not_max.not.not.i99, label %cond_28_case_0.i100, label %__hugr__.__tk2_sol_qalloc.24.exit101 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_28_case_0.i100: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i100) +__hugr__.__tk2_sol_qalloc.24.exit101: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit + tail call void @___reset(i64 %qalloc.i98) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i100, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i100, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i98, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i98, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %0 = tail call ptr @heap_alloc(i64 16) @@ -44,26 +44,26 @@ __hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %1, align 1 store i64 %qalloc.i, ptr %0, align 4 %2 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i100, ptr %2, align 4 + store i64 %qalloc.i98, ptr %2, align 4 %3 = load i64, ptr %1, align 4 %4 = and i64 %3, 3 store i64 %4, ptr %1, align 4 %5 = icmp eq i64 %4, 0 br i1 %5, label %__barray_mask_check_not_borrowed.exit103, label %mask_block_err.i -mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +mask_block_err.i: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_qalloc.24.exit101 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 %6 = alloca [2 x i1], align 1 store i1 false, ptr %6, align 1 - %.repack99 = getelementptr inbounds nuw i8, ptr %6, i64 1 - store i1 false, ptr %.repack99, align 1 + %.repack97 = getelementptr inbounds nuw i8, ptr %6, i64 1 + store i1 false, ptr %.repack97, align 1 store i32 2, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 store ptr %0, ptr %arr_ptr, align 8 @@ -73,6 +73,8 @@ __barray_mask_check_not_borrowed.exit103: ; preds = %__hugr__.__tk2_sol_ store i64 0, ptr %7, align 1 %8 = load i64, ptr %0, align 4 %9 = load i64, ptr %2, align 4 + %lazy_measure = call i64 @___lazy_measure(i64 %8) + call void @___qfree(i64 %8) %10 = call ptr @heap_alloc(i64 8) %11 = call ptr @heap_alloc(i64 8) store i64 0, ptr %11, align 1 @@ -88,8 +90,6 @@ mask_block_err.i104: ; preds = %__barray_mask_check unreachable __barray_mask_check_not_borrowed.exit107: ; preds = %__barray_mask_check_not_borrowed.exit103 - %lazy_measure = call i64 @___lazy_measure(i64 %8) - call void @___qfree(i64 %8) %read_bool = call i1 @___read_future_bool(i64 %lazy_measure) call void @___dec_future_refcount(i64 %lazy_measure) call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_quantum_replay_state[1-StimPlugin]/quantum_replay_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..82ebd482 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..3ef3b9f7 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..8625f909 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..27d01fc6 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..e63a4582 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..1c6714c6 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..c071dd4b --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..be8a8d80 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..0514adfc --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..996f9608 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[QuestPlugin]/qubit_ordering_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..82ebd482 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-apple-darwin.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..3ef3b9f7 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..8625f909 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-apple-darwin.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..27d01fc6 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..e63a4582 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-helios-x86_64-windows-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_helios_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_helios_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rxy(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..1c6714c6 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-apple-darwin.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..c071dd4b --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,251 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load i64, ptr %16, align 4 + %25 = load i64, ptr %18, align 4 + %26 = call ptr @heap_alloc(i64 16) + %27 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %27, align 1 + store i64 %25, ptr %26, align 4 + %28 = getelementptr inbounds nuw i8, ptr %26, i64 8 + store i64 %24, ptr %28, align 4 + %29 = load i64, ptr %27, align 4 + %30 = and i64 %29, 3 + store i64 %30, ptr %27, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %26, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %28, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %26, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..be8a8d80 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-apple-darwin.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..0514adfc --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..996f9608 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state-sol-x86_64-windows-gnu.ll @@ -0,0 +1,250 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_default.C29723C4.0 = private constant [19 x i8] c"\12USER:STATE:default" +@res_reversed.22BDFB76.0 = private constant [20 x i8] c"\13USER:STATE:reversed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +alloca_block: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_312_case_0.i, label %__hugr__.__tk2_sol_qalloc.308.exit + +cond_312_case_0.i: ; preds = %cond_exit_12, %alloca_block + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__hugr__.__tk2_sol_qalloc.308.exit: ; preds = %alloca_block + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_exit_12, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.308.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.308.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_312_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not329 = icmp eq i64 %6, 0 + br i1 %.not329, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %1, align 4 + %10 = trunc i64 %9 to i1 + br i1 %10, label %panic.i310, label %__barray_mask_borrow.exit + +panic.i310: ; preds = %cond_exit_12.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit: ; preds = %cond_exit_12.1 + %11 = or disjoint i64 %9, 1 + store i64 %11, ptr %1, align 4 + %12 = and i64 %9, 2 + %.not = icmp eq i64 %12, 0 + br i1 %.not, label %__barray_mask_borrow.exit312, label %panic.i311 + +panic.i311: ; preds = %__barray_mask_borrow.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit312: ; preds = %__barray_mask_borrow.exit + %13 = load i64, ptr %0, align 4 + %14 = or disjoint i64 %9, 3 + store i64 %14, ptr %1, align 4 + %15 = load i64, ptr %8, align 4 + tail call void @___rp(i64 %13, double 0x400921FB54442D18, double 0.000000e+00) + %16 = tail call ptr @heap_alloc(i64 16) + %17 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %17, align 1 + store i64 %13, ptr %16, align 4 + %18 = getelementptr inbounds nuw i8, ptr %16, i64 8 + store i64 %15, ptr %18, align 4 + %19 = load i64, ptr %17, align 4 + %20 = and i64 %19, 3 + store i64 %20, ptr %17, align 4 + %21 = icmp eq i64 %20, 0 + br i1 %21, label %__barray_mask_check_not_borrowed.exit315, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit312 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit315: ; preds = %__barray_mask_borrow.exit312 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %22 = alloca [2 x i1], align 1 + store i1 false, ptr %22, align 1 + %.repack308 = getelementptr inbounds nuw i8, ptr %22, i64 1 + store i1 false, ptr %.repack308, align 1 + store i32 2, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %16, ptr %arr_ptr, align 8 + store ptr %22, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_default.C29723C4.0, i64 18, ptr nonnull %out_arr_alloca) + %23 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %23, align 1 + %24 = load <2 x i64>, ptr %16, align 4 + %25 = call ptr @heap_alloc(i64 16) + %26 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %26, align 1 + %27 = shufflevector <2 x i64> %24, <2 x i64> poison, <2 x i32> + store <2 x i64> %27, ptr %25, align 4 + %28 = load i64, ptr %26, align 4 + %29 = and i64 %28, 3 + store i64 %29, ptr %26, align 4 + %30 = icmp eq i64 %29, 0 + br i1 %30, label %__barray_mask_check_not_borrowed.exit321, label %mask_block_err.i316 + +mask_block_err.i316: ; preds = %__barray_mask_check_not_borrowed.exit315 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit321: ; preds = %__barray_mask_check_not_borrowed.exit315 + %31 = getelementptr inbounds nuw i8, ptr %25, i64 8 + %out_arr_alloca184 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr186 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 4 + %arr_ptr187 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 8 + %mask_ptr188 = getelementptr inbounds nuw i8, ptr %out_arr_alloca184, i64 16 + %32 = alloca [2 x i1], align 1 + store i1 false, ptr %32, align 1 + %.repack309 = getelementptr inbounds nuw i8, ptr %32, i64 1 + store i1 false, ptr %.repack309, align 1 + store i32 2, ptr %out_arr_alloca184, align 8 + store i32 1, ptr %y_ptr186, align 4 + store ptr %25, ptr %arr_ptr187, align 8 + store ptr %32, ptr %mask_ptr188, align 8 + call void @print_state_result(ptr nonnull @res_reversed.22BDFB76.0, i64 19, ptr nonnull %out_arr_alloca184) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %31, align 4 + %35 = load i64, ptr %1, align 4 + %36 = and i64 %35, 2 + %.not327 = icmp eq i64 %36, 0 + br i1 %.not327, label %panic.i322, label %__barray_mask_return.exit323 + +panic.i322: ; preds = %__barray_mask_check_not_borrowed.exit321 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit323: ; preds = %__barray_mask_check_not_borrowed.exit321 + %37 = load i64, ptr %25, align 4 + %38 = and i64 %35, -3 + store i64 %38, ptr %1, align 4 + store i64 %37, ptr %8, align 4 + %39 = load i64, ptr %1, align 4 + %40 = trunc i64 %39 to i1 + br i1 %40, label %__barray_mask_return.exit325, label %panic.i324 + +panic.i324: ; preds = %__barray_mask_return.exit323 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit325: ; preds = %__barray_mask_return.exit323 + %41 = and i64 %39, -2 + store i64 %41, ptr %1, align 4 + store i64 %34, ptr %0, align 4 + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit325 + %44 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %42, %__barray_mask_return.exit325 ] + %45 = and i64 %44, 2 + %.not.i = icmp eq i64 %45, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_192.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %46 = or disjoint i64 %44, 2 + store i64 %46, ptr %1, align 4 + %47 = load i64, ptr %8, align 4 + call void @___qfree(i64 %47) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_192.1.i + +cond_exit_192.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %48 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %44, %__barray_check_bounds.exit.1.i ] + %49 = or i64 %48, -4 + store i64 %49, ptr %1, align 4 + %50 = icmp eq i64 %49, -1 + br i1 %50, label %"__hugr__.guppylang.std.quantum.discard_array$2.146.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_192.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit325 + %51 = or disjoint i64 %42, 1 + store i64 %51, ptr %1, align 4 + %52 = load i64, ptr %0, align 4 + call void @___qfree(i64 %52) + %.pre = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.146.exit": ; preds = %cond_exit_192.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_qubit_ordering_state[StimPlugin]/qubit_ordering_state.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll index 36370258..74152399 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll index d85e357c..7c64f725 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll index 15a4ba8f..a177c3cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll index fc22bdd5..90c3f63a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll index aa0155f7..6b8ed3f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll index c8ac497d..cecbb60d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll index cf3b49f1..b1f9614f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll index c3165a5c..2f697906 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll index 024feee5..6095c528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll index bc9b9d7d..ef8d77b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-QuestPlugin]/array_state_cleanup.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll index 36370258..74152399 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll index d85e357c..7c64f725 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll index 15a4ba8f..a177c3cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll index fc22bdd5..90c3f63a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll index aa0155f7..6b8ed3f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll index c8ac497d..cecbb60d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll index cf3b49f1..b1f9614f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll index c3165a5c..2f697906 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll index 024feee5..6095c528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll index bc9b9d7d..ef8d77b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[False-StimPlugin]/array_state_cleanup.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll index 36370258..74152399 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll index d85e357c..7c64f725 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll index 15a4ba8f..a177c3cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll index fc22bdd5..90c3f63a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll index aa0155f7..6b8ed3f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll index c8ac497d..cecbb60d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll index cf3b49f1..b1f9614f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll index c3165a5c..2f697906 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll index 024feee5..6095c528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll index bc9b9d7d..ef8d77b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-QuestPlugin]/array_state_cleanup.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-QuestPlugin]/array_state_cleanup.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll index 36370258..74152399 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll index d85e357c..7c64f725 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll index 15a4ba8f..a177c3cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll index fc22bdd5..90c3f63a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll index aa0155f7..6b8ed3f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_helios_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_helios_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rxy(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll index c8ac497d..cecbb60d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "aarch64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll index cf3b49f1..b1f9614f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[False-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "aarch64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll index c3165a5c..2f697906 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll @@ -11,101 +11,102 @@ target triple = "x86_64-apple-darwin" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll index 024feee5..6095c528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-unknown-linux-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll similarity index 66% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll index bc9b9d7d..ef8d77b8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll @@ -11,101 +11,102 @@ target triple = "x86_64-windows-gnu" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { -alloca_block: +cond_104_case_1: %0 = tail call ptr @heap_alloc(i64 16) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_317_case_0.i, label %__hugr__.__tk2_sol_qalloc.313.exit + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit -cond_317_case_0.i: ; preds = %cond_exit_20, %alloca_block +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.313.exit: ; preds = %alloca_block +__barray_check_bounds.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) %2 = load i64, ptr %1, align 4 %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + br i1 %3, label %cond_104_case_1.1, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.1, %__hugr__.__tk2_sol_qalloc.313.exit +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.313.exit +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit %4 = and i64 %2, -2 store i64 %4, ptr %1, align 4 store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_317_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 tail call void @___reset(i64 %qalloc.i.1) %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 + br i1 %.not, label %panic.i, label %cond_exit_104.2 -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 %7 = and i64 %5, -3 store i64 %7, ptr %1, align 4 %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %qalloc.i.1, ptr %8, align 4 - %9 = load i64, ptr %1, align 4 - %10 = trunc i64 %9 to i1 - br i1 %10, label %panic.i336, label %__barray_check_bounds.exit338 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 -panic.i336: ; preds = %__barray_check_bounds.exit335.1, %cond_exit_20.1 +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit338: ; preds = %cond_exit_20.1 - %11 = or disjoint i64 %9, 1 - store i64 %11, ptr %1, align 4 - %12 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %12, double 0x400921FB54442D18, double 0.000000e+00) - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %__barray_check_bounds.exit335.1, label %panic.i339 +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 -panic.i339: ; preds = %__barray_check_bounds.exit338.1, %__barray_check_bounds.exit338 +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit335.1: ; preds = %__barray_check_bounds.exit338 - %15 = and i64 %13, -2 - store i64 %15, ptr %1, align 4 - store i64 %12, ptr %0, align 4 - %16 = load i64, ptr %1, align 4 - %17 = and i64 %16, 2 - %.not361 = icmp eq i64 %17, 0 - br i1 %.not361, label %__barray_check_bounds.exit338.1, label %panic.i336 - -__barray_check_bounds.exit338.1: ; preds = %__barray_check_bounds.exit335.1 - %18 = or disjoint i64 %16, 2 - store i64 %18, ptr %1, align 4 - %19 = load i64, ptr %8, align 4 +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) %20 = load i64, ptr %1, align 4 %21 = and i64 %20, 2 - %.not362 = icmp eq i64 %21, 0 - br i1 %.not362, label %panic.i339, label %__barray_mask_return.exit340.1 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 -__barray_mask_return.exit340.1: ; preds = %__barray_check_bounds.exit338.1 +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 %22 = and i64 %20, -3 store i64 %22, ptr %1, align 4 - store i64 %19, ptr %8, align 4 + store i64 %19, ptr %18, align 4 %23 = load i64, ptr %1, align 4 %24 = trunc i64 %23 to i1 - br i1 %24, label %panic.i341, label %__barray_mask_borrow.exit342 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 -panic.i341: ; preds = %__barray_mask_return.exit340.1 +panic.i551: ; preds = %__barray_mask_return.exit550.1 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit342: ; preds = %__barray_mask_return.exit340.1 +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 %25 = or disjoint i64 %23, 1 store i64 %25, ptr %1, align 4 %26 = load i64, ptr %0, align 4 @@ -119,11 +120,11 @@ __barray_mask_borrow.exit342: ; preds = %__barray_mask_retur %31 = icmp eq i64 %30, 0 br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %__barray_mask_borrow.exit342 +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit342 +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 @@ -139,13 +140,13 @@ __barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borro store i64 0, ptr %33, align 1 %34 = load i64, ptr %1, align 4 %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit345, label %panic.i344 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 -panic.i344: ; preds = %__barray_mask_check_not_borrowed.exit +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit345: ; preds = %__barray_mask_check_not_borrowed.exit +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit %36 = load i64, ptr %27, align 4 %37 = and i64 %34, -2 store i64 %37, ptr %1, align 4 @@ -154,40 +155,40 @@ __barray_mask_return.exit345: ; preds = %__barray_mask_check %39 = trunc i64 %38 to i1 br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i -__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit345 - %40 = phi i64 [ %.pre, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit345 ] +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] %41 = and i64 %40, 2 %.not.i = icmp eq i64 %41, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_231.i + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i __barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i %42 = or disjoint i64 %40, 2 store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %8, align 4 + %43 = load i64, ptr %18, align 4 call void @___qfree(i64 %43) %.pre.i = load i64, ptr %1, align 4 - br label %cond_exit_231.i + br label %cond_exit_276.1.i -cond_exit_231.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] %45 = or i64 %44, -4 store i64 %45, ptr %1, align 4 %46 = icmp eq i64 %45, -1 - br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.189.exit", label %mask_block_err.i.i + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_exit_231.i +mask_block_err.i.i: ; preds = %cond_exit_276.1.i call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit345 +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 %47 = or disjoint i64 %38, 1 store i64 %47, ptr %1, align 4 %48 = load i64, ptr %0, align 4 call void @___qfree(i64 %48) - %.pre = load i64, ptr %1, align 4 + %.pre557 = load i64, ptr %1, align 4 br label %__barray_check_bounds.exit.1.i -"__hugr__.guppylang.std.quantum.discard_array$2.189.exit": ; preds = %cond_exit_231.i +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i call void @heap_free(ptr nonnull %0) call void @heap_free(ptr nonnull %1) ret void @@ -200,10 +201,10 @@ declare void @panic(i32, ptr) local_unnamed_addr #0 declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr -declare void @heap_free(ptr) local_unnamed_addr - declare void @___qfree(i64) local_unnamed_addr +declare void @heap_free(ptr) local_unnamed_addr + declare void @___rp(i64, double, double) local_unnamed_addr declare i64 @___qalloc() local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[None-StimPlugin]/array_state_cleanup.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[None-StimPlugin]/array_state_cleanup.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..74152399 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..7c64f725 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..a177c3cc --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..90c3f63a --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..6b8ed3f5 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..cecbb60d --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..b1f9614f --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..2f697906 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..6095c528 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..ef8d77b8 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-QuestPlugin]/array_state_cleanup.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-QuestPlugin]/array_state_cleanup.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll new file mode 100644 index 00000000..74152399 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..7c64f725 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll new file mode 100644 index 00000000..a177c3cc --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..90c3f63a --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll new file mode 100644 index 00000000..6b8ed3f5 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-helios-x86_64-windows-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rxy(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rxy(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rxy(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll new file mode 100644 index 00000000..cecbb60d --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll new file mode 100644 index 00000000..b1f9614f --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-aarch64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" +target triple = "aarch64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll new file mode 100644 index 00000000..2f697906 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-apple-darwin.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-darwin" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll new file mode 100644 index 00000000..6095c528 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-unknown-linux-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll new file mode 100644 index 00000000..ef8d77b8 --- /dev/null +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup-sol-x86_64-windows-gnu.ll @@ -0,0 +1,230 @@ +; ModuleID = 'hugr' +source_filename = "hugr" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-windows-gnu" + +@"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_array_stat.71E0AE77.0 = private constant [23 x i8] c"\16USER:STATE:array_state" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." + +define void @__hugr__.__main__.main.1() local_unnamed_addr { +cond_104_case_1: + %0 = tail call ptr @heap_alloc(i64 16) + %1 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %1, align 1 + %qalloc.i = tail call i64 @___qalloc() + %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 + br i1 %not_max.not.not.i, label %cond_406_case_0.i, label %__barray_check_bounds.exit + +cond_406_case_0.i: ; preds = %cond_104_case_1.1, %cond_104_case_1 + tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") + unreachable + +__barray_check_bounds.exit: ; preds = %cond_104_case_1 + tail call void @___reset(i64 %qalloc.i) + %2 = load i64, ptr %1, align 4 + %3 = trunc i64 %2 to i1 + br i1 %3, label %cond_104_case_1.1, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit.1, %__barray_check_bounds.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_104_case_1.1: ; preds = %__barray_check_bounds.exit + %4 = and i64 %2, -2 + store i64 %4, ptr %1, align 4 + store i64 %qalloc.i, ptr %0, align 4 + %qalloc.i.1 = tail call i64 @___qalloc() + %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 + br i1 %not_max.not.not.i.1, label %cond_406_case_0.i, label %__barray_check_bounds.exit.1 + +__barray_check_bounds.exit.1: ; preds = %cond_104_case_1.1 + tail call void @___reset(i64 %qalloc.i.1) + %5 = load i64, ptr %1, align 4 + %6 = and i64 %5, 2 + %.not = icmp eq i64 %6, 0 + br i1 %.not, label %panic.i, label %cond_exit_104.2 + +cond_exit_104.2: ; preds = %__barray_check_bounds.exit.1 + %7 = and i64 %5, -3 + store i64 %7, ptr %1, align 4 + %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %qalloc.i.1, ptr %8, align 4 + %.pre = load i64, ptr %1, align 4 + %9 = trunc i64 %.pre to i1 + br i1 %9, label %panic.i546, label %__barray_check_bounds.exit548 + +panic.i546: ; preds = %__barray_check_bounds.exit545.1, %cond_exit_104.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_check_bounds.exit548: ; preds = %cond_exit_104.2 + %10 = or disjoint i64 %.pre, 1 + store i64 %10, ptr %1, align 4 + %11 = load i64, ptr %0, align 4 + tail call void @___rp(i64 %11, double 0x400921FB54442D18, double 0.000000e+00) + %12 = load i64, ptr %1, align 4 + %13 = trunc i64 %12 to i1 + br i1 %13, label %__barray_check_bounds.exit545.1, label %panic.i549 + +panic.i549: ; preds = %__barray_check_bounds.exit548.1, %__barray_check_bounds.exit548 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit545.1: ; preds = %__barray_check_bounds.exit548 + %14 = and i64 %12, -2 + store i64 %14, ptr %1, align 4 + store i64 %11, ptr %0, align 4 + %15 = load i64, ptr %1, align 4 + %16 = and i64 %15, 2 + %.not558 = icmp eq i64 %16, 0 + br i1 %.not558, label %__barray_check_bounds.exit548.1, label %panic.i546 + +__barray_check_bounds.exit548.1: ; preds = %__barray_check_bounds.exit545.1 + %17 = or disjoint i64 %15, 2 + store i64 %17, ptr %1, align 4 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 4 + tail call void @___rp(i64 %19, double 0x400921FB54442D18, double 0.000000e+00) + %20 = load i64, ptr %1, align 4 + %21 = and i64 %20, 2 + %.not559 = icmp eq i64 %21, 0 + br i1 %.not559, label %panic.i549, label %__barray_mask_return.exit550.1 + +__barray_mask_return.exit550.1: ; preds = %__barray_check_bounds.exit548.1 + %22 = and i64 %20, -3 + store i64 %22, ptr %1, align 4 + store i64 %19, ptr %18, align 4 + %23 = load i64, ptr %1, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %panic.i551, label %__barray_mask_borrow.exit552 + +panic.i551: ; preds = %__barray_mask_return.exit550.1 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +__barray_mask_borrow.exit552: ; preds = %__barray_mask_return.exit550.1 + %25 = or disjoint i64 %23, 1 + store i64 %25, ptr %1, align 4 + %26 = load i64, ptr %0, align 4 + %27 = tail call ptr @heap_alloc(i64 8) + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %26, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + +mask_block_err.i: ; preds = %__barray_mask_borrow.exit552 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_mask_check_not_borrowed.exit: ; preds = %__barray_mask_borrow.exit552 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 + store i32 1, ptr %out_arr_alloca, align 8 + store i32 1, ptr %y_ptr, align 4 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 + call void @print_state_result(ptr nonnull @res_array_stat.71E0AE77.0, i64 22, ptr nonnull %out_arr_alloca) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %1, align 4 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit555, label %panic.i554 + +panic.i554: ; preds = %__barray_mask_check_not_borrowed.exit + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_mask_return.exit555: ; preds = %__barray_mask_check_not_borrowed.exit + %36 = load i64, ptr %27, align 4 + %37 = and i64 %34, -2 + store i64 %37, ptr %1, align 4 + store i64 %36, ptr %0, align 4 + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %__barray_check_bounds.exit.1.i, label %__barray_mask_borrow.exit.i + +__barray_check_bounds.exit.1.i: ; preds = %__barray_mask_borrow.exit.i, %__barray_mask_return.exit555 + %40 = phi i64 [ %.pre557, %__barray_mask_borrow.exit.i ], [ %38, %__barray_mask_return.exit555 ] + %41 = and i64 %40, 2 + %.not.i = icmp eq i64 %41, 0 + br i1 %.not.i, label %__barray_mask_borrow.exit.1.i, label %cond_exit_276.1.i + +__barray_mask_borrow.exit.1.i: ; preds = %__barray_check_bounds.exit.1.i + %42 = or disjoint i64 %40, 2 + store i64 %42, ptr %1, align 4 + %43 = load i64, ptr %18, align 4 + call void @___qfree(i64 %43) + %.pre.i = load i64, ptr %1, align 4 + br label %cond_exit_276.1.i + +cond_exit_276.1.i: ; preds = %__barray_mask_borrow.exit.1.i, %__barray_check_bounds.exit.1.i + %44 = phi i64 [ %.pre.i, %__barray_mask_borrow.exit.1.i ], [ %40, %__barray_check_bounds.exit.1.i ] + %45 = or i64 %44, -4 + store i64 %45, ptr %1, align 4 + %46 = icmp eq i64 %45, -1 + br i1 %46, label %"__hugr__.guppylang.std.quantum.discard_array$2.230.exit", label %mask_block_err.i.i + +mask_block_err.i.i: ; preds = %cond_exit_276.1.i + call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit.i: ; preds = %__barray_mask_return.exit555 + %47 = or disjoint i64 %38, 1 + store i64 %47, ptr %1, align 4 + %48 = load i64, ptr %0, align 4 + call void @___qfree(i64 %48) + %.pre557 = load i64, ptr %1, align 4 + br label %__barray_check_bounds.exit.1.i + +"__hugr__.guppylang.std.quantum.discard_array$2.230.exit": ; preds = %cond_exit_276.1.i + call void @heap_free(ptr nonnull %0) + call void @heap_free(ptr nonnull %1) + ret void +} + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare void @print_state_result(ptr, i64, ptr) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @heap_free(ptr) local_unnamed_addr + +declare void @___rp(i64, double, double) local_unnamed_addr + +declare i64 @___qalloc() local_unnamed_addr + +declare void @___reset(i64) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr { +entry: + tail call void @setup(i64 %0) + tail call void @__hugr__.__main__.main.1() + %1 = tail call i64 @teardown() + ret i64 %1 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } + +!name = !{!0} + +!0 = !{!"mainlib"} diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_state_cleanup[True-StimPlugin]/array_state_cleanup.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_state_cleanup[True-StimPlugin]/array_state_cleanup.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll index 082218e6..88d77bd6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll index 107f5e5e..ffd13e8b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll index 03117a03..efd2ff7e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll index a905e818..12291912 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll index 45919e24..04703770 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll index 40c0a6bd..be228d4b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll index d7438642..421b5365 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll index c86d0523..437b7221 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll index a4fa4aa1..8e169111 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll index 1c43555a..10bdc849 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll index 082218e6..88d77bd6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll index 107f5e5e..ffd13e8b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll index 03117a03..efd2ff7e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll index a905e818..12291912 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll index 45919e24..04703770 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-helios-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll index 40c0a6bd..be228d4b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-helios]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll index d7438642..421b5365 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll index c86d0523..437b7221 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll index a4fa4aa1..8e169111 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll index 1c43555a..10bdc849 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx-sol-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0.000000e+00) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rx-sol]/stim_gate_implementation_rx.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll index f6a3ad1a..7c245258 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll index e7ce7462..d09484fb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll index 8da92bdf..fb25d849 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll index 822d4c98..0cffe407 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll index 9e5df103..7159db74 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll index 86bff848..e5ec04a4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll index aaed5393..aa64eba4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll index 9573b42a..2ab2d974 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll index ea8d86c5..a74f689c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll index 10d98f9a..53fe6543 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll index f6a3ad1a..7c245258 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll index e7ce7462..d09484fb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll index 8da92bdf..fb25d849 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll index 822d4c98..0cffe407 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll index 9e5df103..7159db74 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-helios-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rxy(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll index 86bff848..e5ec04a4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll index aaed5393..aa64eba4 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll index 9573b42a..2ab2d974 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll index ea8d86c5..a74f689c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-helios]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll index 10d98f9a..53fe6543 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry-sol-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rp(i64 %qalloc.i, double %7, double 0x3FF921FB54442D18) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[ry-sol]/stim_gate_implementation_ry.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll index 3ee0ef69..637392dc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll index dd55d831..f0d85cac 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll index 9d412d2b..bc254e49 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll index 22db3e65..ed925ba2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll index f32b7c84..8e432c78 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll index 66775575..bdf28a14 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll index 6bbd2e84..f01ed37b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll index 0d85a012..2621bd7f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll index e26ab02f..8eea62f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll index 3e821757..ed71e6bd 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll index 3ee0ef69..637392dc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll index dd55d831..f0d85cac 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll index 9d412d2b..bc254e49 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll index 22db3e65..ed925ba2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll index f32b7c84..8e432c78 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-helios-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_helios_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_helios_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll index 66775575..bdf28a14 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32: target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll index 6bbd2e84..f01ed37b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-aarch64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i6 target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll index 0d85a012..2621bd7f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-apple-darwin.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll index e26ab02f..8eea62f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-unknown-linux-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll similarity index 95% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll index 3e821757..ed71e6bd 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-helios]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz-sol-x86_64-windows-gnu.ll @@ -4,45 +4,52 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80: target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1.150c532c.0" = local_unnamed_addr constant { i64, [1000 x double] } { i64 1000, [1000 x double] [double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.500000e+00, double 1.500000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double 3.000000e+00, double -2.000000e+00, double -3.000000e+00, double -1.500000e+00, double -2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 3.500000e+00, double -5.000000e-01, double -3.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double -3.000000e+00, double 5.000000e-01, double 3.500000e+00, double 1.500000e+00, double 0.000000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -4.000000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -1.500000e+00, double -3.500000e+00, double -3.000000e+00, double 3.500000e+00, double -1.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double -4.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double 0.000000e+00, double -3.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.000000e+00, double 1.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double 3.500000e+00, double -1.500000e+00, double 3.000000e+00, double 4.000000e+00, double 3.000000e+00, double 5.000000e-01, double 0.000000e+00, double -2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 2.500000e+00, double -2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 3.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.500000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -2.000000e+00, double 1.000000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 5.000000e-01, double -3.500000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.000000e+00, double -3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 2.500000e+00, double -1.000000e+00, double -2.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double -1.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.500000e+00, double -2.000000e+00, double 3.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double -2.000000e+00, double -3.500000e+00, double -1.500000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double -1.500000e+00, double -4.000000e+00, double -3.500000e+00, double -3.000000e+00, double -2.000000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double -3.500000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 2.500000e+00, double 3.500000e+00, double -1.500000e+00, double 2.000000e+00, double 3.500000e+00, double -1.500000e+00, double 5.000000e-01, double 1.500000e+00, double 1.500000e+00, double -1.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -2.500000e+00, double -4.000000e+00, double 1.500000e+00, double 3.500000e+00, double -3.000000e+00, double -2.000000e+00, double 1.000000e+00, double 1.500000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 4.000000e+00, double 0.000000e+00, double -3.000000e+00, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -5.000000e-01, double 0.000000e+00, double 1.500000e+00, double -2.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 4.000000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double -3.000000e+00, double 5.000000e-01, double 0.000000e+00, double 3.500000e+00, double -5.000000e-01, double 1.500000e+00, double 4.000000e+00, double -3.000000e+00, double -4.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.000000e+00, double -3.000000e+00, double -2.000000e+00, double -5.000000e-01, double -1.500000e+00, double 4.000000e+00, double 4.000000e+00, double 2.000000e+00, double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 1.500000e+00, double -3.000000e+00, double 1.500000e+00, double 2.500000e+00, double -3.500000e+00, double -3.000000e+00, double 1.000000e+00, double -5.000000e-01, double -1.000000e+00, double 1.500000e+00, double 4.000000e+00, double 2.000000e+00, double 3.500000e+00, double -3.500000e+00, double -4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 3.500000e+00, double -5.000000e-01, double -4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double -4.000000e+00, double -1.000000e+00, double -1.000000e+00, double -2.000000e+00, double 4.000000e+00, double -2.000000e+00, double 0.000000e+00, double -3.500000e+00, double 3.000000e+00, double 1.500000e+00, double 1.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 1.500000e+00, double -5.000000e-01, double 5.000000e-01, double -4.000000e+00, double 1.000000e+00, double 0.000000e+00, double -2.500000e+00, double -3.500000e+00, double -1.000000e+00, double 1.500000e+00, double -1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double -1.500000e+00, double -4.000000e+00, double 2.500000e+00, double -5.000000e-01, double -1.000000e+00, double 3.000000e+00, double 0.000000e+00, double -1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 4.000000e+00, double 3.500000e+00, double 3.500000e+00, double 3.500000e+00, double 4.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.500000e+00, double 4.000000e+00, double 2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 3.500000e+00, double -2.500000e+00, double -2.000000e+00, double 0.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 4.000000e+00, double 1.500000e+00, double 2.000000e+00, double -1.000000e+00, double 3.500000e+00, double 3.000000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -1.500000e+00, double 1.000000e+00, double -1.500000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double -1.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.500000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, double -5.000000e-01, double -2.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 0.000000e+00, double 2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.000000e+00, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -1.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -5.000000e-01, double 1.500000e+00, double -1.000000e+00, double 2.500000e+00, double 3.000000e+00, double -4.000000e+00, double 2.000000e+00, double -3.000000e+00, double -3.000000e+00, double -3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 3.500000e+00, double 2.000000e+00, double -5.000000e-01, double 5.000000e-01, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double 4.000000e+00, double 3.000000e+00, double -3.000000e+00, double 5.000000e-01, double -4.000000e+00, double 4.000000e+00, double -1.500000e+00, double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.500000e+00, double -1.500000e+00, double 4.000000e+00, double -2.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.500000e+00, double 1.000000e+00, double -2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 3.500000e+00, double 0.000000e+00, double 1.000000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 0.000000e+00, double -2.000000e+00, double 0.000000e+00, double -2.000000e+00, double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 2.500000e+00, double -4.000000e+00, double 4.000000e+00, double 1.500000e+00, double -1.000000e+00, double -5.000000e-01, double -4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -4.000000e+00, double 2.500000e+00, double 2.500000e+00, double 3.500000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -5.000000e-01, double 3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double -4.000000e+00, double 5.000000e-01, double -2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 2.000000e+00, double 2.500000e+00, double -1.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.000000e+00, double -2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -1.500000e+00, double -3.000000e+00, double 1.500000e+00, double -1.500000e+00, double -5.000000e-01, double -3.000000e+00, double 4.000000e+00, double 2.000000e+00, double -3.500000e+00, double -2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double 1.500000e+00, double 4.000000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.500000e+00, double -4.000000e+00, double 5.000000e-01, double -1.500000e+00, double -5.000000e-01, double 3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 4.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -3.500000e+00, double 5.000000e-01, double 3.500000e+00, double -4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 1.000000e+00, double 5.000000e-01, double -2.500000e+00, double -3.000000e+00, double 2.500000e+00, double 1.000000e+00, double 4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 3.000000e+00, double 4.000000e+00, double -1.500000e+00, double 2.000000e+00, double -2.500000e+00, double 4.000000e+00, double 1.000000e+00, double 4.000000e+00, double -1.000000e+00, double 4.000000e+00, double -2.500000e+00, double 2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 4.000000e+00, double -2.000000e+00, double -3.000000e+00, double 1.000000e+00, double 3.500000e+00, double 0.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00, double -4.000000e+00, double 1.500000e+00, double -3.500000e+00, double -1.000000e+00, double -2.500000e+00, double 3.000000e+00, double -1.500000e+00, double -3.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.000000e+00, double 5.000000e-01, double -3.500000e+00, double 1.000000e+00, double 1.000000e+00, double -1.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 5.000000e-01, double -4.000000e+00, double -3.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double -4.000000e+00, double 2.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.000000e+00, double -3.000000e+00, double 1.500000e+00, double 1.000000e+00, double 1.500000e+00, double 2.000000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -2.000000e+00, double -2.000000e+00, double 3.000000e+00, double 1.500000e+00, double -2.000000e+00, double -2.500000e+00, double -3.500000e+00, double 0.000000e+00, double -1.500000e+00, double -3.500000e+00, double 1.000000e+00, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double 2.500000e+00, double 1.500000e+00, double -4.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.500000e+00, double -5.000000e-01, double 2.500000e+00, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -2.000000e+00, double 2.000000e+00, double 4.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00, double -2.000000e+00, double 1.500000e+00, double -2.000000e+00, double 0.000000e+00, double 5.000000e-01, double -5.000000e-01, double 5.000000e-01, double -1.500000e+00, double -2.000000e+00, double 3.000000e+00, double -3.500000e+00, double 0.000000e+00, double 2.500000e+00, double 1.500000e+00, double -3.500000e+00, double 1.500000e+00, double -4.000000e+00, double 4.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double -1.000000e+00, double 3.500000e+00, double 2.000000e+00, double 5.000000e-01, double 1.000000e+00, double 2.000000e+00, double 2.500000e+00, double 0.000000e+00, double 3.000000e+00, double 4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 0.000000e+00, double -1.000000e+00, double 1.000000e+00, double -2.500000e+00, double 2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 2.500000e+00, double 5.000000e-01, double 2.000000e+00, double 2.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double 3.000000e+00, double 1.500000e+00, double -1.000000e+00, double 4.000000e+00, double -1.500000e+00, double -3.500000e+00, double 2.000000e+00, double 3.000000e+00, double -2.000000e+00, double -5.000000e-01, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 2.500000e+00, double 0.000000e+00, double -5.000000e-01, double 1.000000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -1.500000e+00, double 0.000000e+00, double -1.500000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double -3.000000e+00, double -1.500000e+00, double 4.000000e+00, double 3.000000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double 5.000000e-01, double -1.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.500000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 5.000000e-01, double 1.500000e+00, double 5.000000e-01, double -1.500000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double -5.000000e-01, double 3.500000e+00, double 2.000000e+00, double -2.500000e+00, double -1.500000e+00, double -3.500000e+00, double -2.500000e+00, double -2.500000e+00, double -2.000000e+00, double -2.000000e+00, double -2.500000e+00, double 3.500000e+00, double 1.500000e+00, double -2.500000e+00, double -4.000000e+00, double -3.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 1.500000e+00, double 3.000000e+00, double -5.000000e-01, double -3.000000e+00, double 1.000000e+00, double -3.500000e+00, double -1.000000e+00, double 5.000000e-01, double 2.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 3.500000e+00, double 5.000000e-01, double 0.000000e+00, double -1.500000e+00, double -1.500000e+00, double 1.000000e+00, double -4.000000e+00, double -3.500000e+00, double 1.000000e+00, double 4.000000e+00, double 1.000000e+00, double 1.500000e+00, double 3.000000e+00, double -2.500000e+00, double 2.500000e+00, double -3.000000e+00, double 5.000000e-01, double 2.500000e+00, double 4.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.000000e+00, double 2.000000e+00, double 0.000000e+00, double 3.500000e+00, double -3.500000e+00, double 2.000000e+00, double -4.000000e+00, double 2.500000e+00, double -4.000000e+00, double -5.000000e-01, double 4.000000e+00, double -3.000000e+00, double -3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 1.500000e+00, double 3.500000e+00, double -3.500000e+00, double -3.500000e+00, double -4.000000e+00, double -4.000000e+00, double -5.000000e-01, double -2.500000e+00, double 2.000000e+00, double 0.000000e+00, double 4.000000e+00, double -5.000000e-01, double 0.000000e+00, double 5.000000e-01, double -3.000000e+00, double -3.000000e+00, double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 2.500000e+00, double 3.500000e+00, double -3.500000e+00, double 3.000000e+00, double 2.500000e+00, double 1.000000e+00, double -1.000000e+00, double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double -4.000000e+00, double 2.500000e+00, double 4.000000e+00, double -4.000000e+00, double 3.000000e+00, double -4.000000e+00, double 0.000000e+00, double 2.500000e+00, double -4.000000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double -1.500000e+00, double -3.000000e+00, double 3.000000e+00, double -5.000000e-01, double -3.500000e+00, double -5.000000e-01, double -2.500000e+00, double 0.000000e+00, double -4.000000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -4.000000e+00, double -1.000000e+00, double -2.000000e+00, double -2.500000e+00, double 1.000000e+00, double -2.500000e+00, double -3.000000e+00, double -3.000000e+00, double -2.500000e+00, double 3.000000e+00, double -3.500000e+00, double -1.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00, double 1.000000e+00, double 1.000000e+00, double -3.500000e+00, double -3.500000e+00, double 2.500000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e-01, double 3.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.500000e+00, double 4.000000e+00, double 1.000000e+00, double 5.000000e-01, double 3.500000e+00, double -2.500000e+00, double 4.000000e+00, double 0.000000e+00, double 3.500000e+00, double 1.500000e+00, double 3.000000e+00, double 1.000000e+00, double -2.500000e+00, double -2.000000e+00, double -1.500000e+00, double -2.500000e+00, double 0.000000e+00, double 2.500000e+00, double 5.000000e-01, double 3.000000e+00, double 4.000000e+00, double 0.000000e+00, double 0.000000e+00, double -3.000000e+00, double -3.500000e+00, double 3.500000e+00, double 1.000000e+00, double 3.000000e+00, double 4.000000e+00, double -2.500000e+00, double -3.500000e+00, double -5.000000e-01, double -3.500000e+00, double -1.000000e+00, double -3.000000e+00, double -2.500000e+00, double 2.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double -2.500000e+00, double 0.000000e+00, double -1.000000e+00, double -2.000000e+00, double 1.500000e+00, double 1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 3.500000e+00, double -3.500000e+00, double 4.000000e+00, double 3.000000e+00, double -3.500000e+00, double 2.500000e+00, double -4.000000e+00, double -1.000000e+00, double -2.500000e+00, double 5.000000e-01, double -1.500000e+00, double 0.000000e+00, double 4.000000e+00, double 2.500000e+00, double -1.500000e+00, double 5.000000e-01, double 3.500000e+00, double -3.000000e+00, double 4.000000e+00, double -3.000000e+00, double -1.000000e+00] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load double, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi double [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_39_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_32_case_0.i, label %__hugr__.__tk2_sol_qalloc.28.exit -cond_39_case_0.i: ; preds = %alloca_block +cond_32_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.28.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit", label %cond_62_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 -cond_62_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable - -"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit": ; preds = %__hugr__.__tk2_sol_qalloc.44.exit - %1 = getelementptr inbounds nuw { i64, [0 x double] }, ptr @"sa.static_pyarray.%tmp1.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load double, ptr %1, align 8 - %3 = tail call double @llvm.fabs.f64(double %2) +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + %3 = tail call double @llvm.fabs.f64(double %"0.sroa.3.0") %4 = fcmp ueq double %3, 0x7FF0000000000000 br i1 %4, label %5, label %6 -5: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.28.exit + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable + +5: ; preds = %cond_10_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -6: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).57.exit" - %7 = fmul double %2, 0x400921FB54442D18 +6: ; preds = %cond_10_case_1 + %7 = fmul double %"0.sroa.3.0", 0x400921FB54442D18 tail call void @___rz(i64 %qalloc.i, double %7) %8 = tail call ptr @heap_alloc(i64 8) %9 = tail call ptr @heap_alloc(i64 8) diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit[rz-sol]/stim_gate_implementation_rz.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll index 582c18fe..345fef77 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll index b133560c..1463316a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll index 92edf1a6..3a89066a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll index 59bb08c2..3783b76f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll index c414a81c..49d23211 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll index 5926983a..18bf4338 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll index c0fbfbce..4f9c6a4d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll index e291f1f9..a4ea824f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll index 9a2f80b2..18fa0847 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll index 39204eca..0ef97da0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples/stim_gate_implementation_triples.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples/stim_gate_implementation_triples.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll index 582c18fe..345fef77 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll index b133560c..1463316a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-aarch64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll index 92edf1a6..3a89066a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll index 59bb08c2..3783b76f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll index c414a81c..49d23211 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-helios-x86_64-windows-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_helios_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_helios_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_helios_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_helios_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rxy(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rxy(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll index 5926983a..18bf4338 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll index c0fbfbce..4f9c6a4d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-aarch64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "aarch64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll index e291f1f9..a4ea824f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-apple-darwin.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-apple-darwin" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll index 9a2f80b2..18fa0847 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-unknown-linux-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-unknown-linux-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll similarity index 97% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll index 39204eca..0ef97da0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples-sol-x86_64-windows-gnu.ll @@ -1004,129 +1004,150 @@ target triple = "x86_64-windows-gnu" @"sa.static_pyarray.%tmp1002.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double -2.500000e+00, double -2.500000e+00, double -1.000000e+00] } @"sa.static_pyarray.%tmp1003.150c532c.0" = constant { i64, [3 x double] } { i64 3, [3 x double] [double 1.500000e+00, double -1.500000e+00, double 3.000000e+00] } @"sa.static_pyarray.%tmp1004.150c532c.0" = local_unnamed_addr constant { i64, [1000 x ptr] } { i64 1000, [1000 x ptr] [ptr @"sa.static_pyarray.%tmp4.150c532c.0", ptr @"sa.static_pyarray.%tmp5.150c532c.0", ptr @"sa.static_pyarray.%tmp6.150c532c.0", ptr @"sa.static_pyarray.%tmp7.150c532c.0", ptr @"sa.static_pyarray.%tmp8.150c532c.0", ptr @"sa.static_pyarray.%tmp9.150c532c.0", ptr @"sa.static_pyarray.%tmp10.150c532c.0", ptr @"sa.static_pyarray.%tmp11.150c532c.0", ptr @"sa.static_pyarray.%tmp12.150c532c.0", ptr @"sa.static_pyarray.%tmp13.150c532c.0", ptr @"sa.static_pyarray.%tmp14.150c532c.0", ptr @"sa.static_pyarray.%tmp15.150c532c.0", ptr @"sa.static_pyarray.%tmp16.150c532c.0", ptr @"sa.static_pyarray.%tmp17.150c532c.0", ptr @"sa.static_pyarray.%tmp18.150c532c.0", ptr @"sa.static_pyarray.%tmp19.150c532c.0", ptr @"sa.static_pyarray.%tmp20.150c532c.0", ptr @"sa.static_pyarray.%tmp21.150c532c.0", ptr @"sa.static_pyarray.%tmp22.150c532c.0", ptr @"sa.static_pyarray.%tmp23.150c532c.0", ptr @"sa.static_pyarray.%tmp24.150c532c.0", ptr @"sa.static_pyarray.%tmp25.150c532c.0", ptr @"sa.static_pyarray.%tmp26.150c532c.0", ptr @"sa.static_pyarray.%tmp27.150c532c.0", ptr @"sa.static_pyarray.%tmp28.150c532c.0", ptr @"sa.static_pyarray.%tmp29.150c532c.0", ptr @"sa.static_pyarray.%tmp30.150c532c.0", ptr @"sa.static_pyarray.%tmp31.150c532c.0", ptr @"sa.static_pyarray.%tmp32.150c532c.0", ptr @"sa.static_pyarray.%tmp33.150c532c.0", ptr @"sa.static_pyarray.%tmp34.150c532c.0", ptr @"sa.static_pyarray.%tmp35.150c532c.0", ptr @"sa.static_pyarray.%tmp36.150c532c.0", ptr @"sa.static_pyarray.%tmp37.150c532c.0", ptr @"sa.static_pyarray.%tmp38.150c532c.0", ptr @"sa.static_pyarray.%tmp39.150c532c.0", ptr @"sa.static_pyarray.%tmp40.150c532c.0", ptr @"sa.static_pyarray.%tmp41.150c532c.0", ptr @"sa.static_pyarray.%tmp42.150c532c.0", ptr @"sa.static_pyarray.%tmp43.150c532c.0", ptr @"sa.static_pyarray.%tmp44.150c532c.0", ptr @"sa.static_pyarray.%tmp45.150c532c.0", ptr @"sa.static_pyarray.%tmp46.150c532c.0", ptr @"sa.static_pyarray.%tmp47.150c532c.0", ptr @"sa.static_pyarray.%tmp48.150c532c.0", ptr @"sa.static_pyarray.%tmp49.150c532c.0", ptr @"sa.static_pyarray.%tmp50.150c532c.0", ptr @"sa.static_pyarray.%tmp51.150c532c.0", ptr @"sa.static_pyarray.%tmp52.150c532c.0", ptr @"sa.static_pyarray.%tmp53.150c532c.0", ptr @"sa.static_pyarray.%tmp54.150c532c.0", ptr @"sa.static_pyarray.%tmp55.150c532c.0", ptr @"sa.static_pyarray.%tmp56.150c532c.0", ptr @"sa.static_pyarray.%tmp57.150c532c.0", ptr @"sa.static_pyarray.%tmp58.150c532c.0", ptr @"sa.static_pyarray.%tmp59.150c532c.0", ptr @"sa.static_pyarray.%tmp60.150c532c.0", ptr @"sa.static_pyarray.%tmp61.150c532c.0", ptr @"sa.static_pyarray.%tmp62.150c532c.0", ptr @"sa.static_pyarray.%tmp63.150c532c.0", ptr @"sa.static_pyarray.%tmp64.150c532c.0", ptr @"sa.static_pyarray.%tmp65.150c532c.0", ptr @"sa.static_pyarray.%tmp66.150c532c.0", ptr @"sa.static_pyarray.%tmp67.150c532c.0", ptr @"sa.static_pyarray.%tmp68.150c532c.0", ptr @"sa.static_pyarray.%tmp69.150c532c.0", ptr @"sa.static_pyarray.%tmp70.150c532c.0", ptr @"sa.static_pyarray.%tmp71.150c532c.0", ptr @"sa.static_pyarray.%tmp72.150c532c.0", ptr @"sa.static_pyarray.%tmp73.150c532c.0", ptr @"sa.static_pyarray.%tmp74.150c532c.0", ptr @"sa.static_pyarray.%tmp75.150c532c.0", ptr @"sa.static_pyarray.%tmp76.150c532c.0", ptr @"sa.static_pyarray.%tmp77.150c532c.0", ptr @"sa.static_pyarray.%tmp78.150c532c.0", ptr @"sa.static_pyarray.%tmp79.150c532c.0", ptr @"sa.static_pyarray.%tmp80.150c532c.0", ptr @"sa.static_pyarray.%tmp81.150c532c.0", ptr @"sa.static_pyarray.%tmp82.150c532c.0", ptr @"sa.static_pyarray.%tmp83.150c532c.0", ptr @"sa.static_pyarray.%tmp84.150c532c.0", ptr @"sa.static_pyarray.%tmp85.150c532c.0", ptr @"sa.static_pyarray.%tmp86.150c532c.0", ptr @"sa.static_pyarray.%tmp87.150c532c.0", ptr @"sa.static_pyarray.%tmp88.150c532c.0", ptr @"sa.static_pyarray.%tmp89.150c532c.0", ptr @"sa.static_pyarray.%tmp90.150c532c.0", ptr @"sa.static_pyarray.%tmp91.150c532c.0", ptr @"sa.static_pyarray.%tmp92.150c532c.0", ptr @"sa.static_pyarray.%tmp93.150c532c.0", ptr @"sa.static_pyarray.%tmp94.150c532c.0", ptr @"sa.static_pyarray.%tmp95.150c532c.0", ptr @"sa.static_pyarray.%tmp96.150c532c.0", ptr @"sa.static_pyarray.%tmp97.150c532c.0", ptr @"sa.static_pyarray.%tmp98.150c532c.0", ptr @"sa.static_pyarray.%tmp99.150c532c.0", ptr @"sa.static_pyarray.%tmp100.150c532c.0", ptr @"sa.static_pyarray.%tmp101.150c532c.0", ptr @"sa.static_pyarray.%tmp102.150c532c.0", ptr @"sa.static_pyarray.%tmp103.150c532c.0", ptr @"sa.static_pyarray.%tmp104.150c532c.0", ptr @"sa.static_pyarray.%tmp105.150c532c.0", ptr @"sa.static_pyarray.%tmp106.150c532c.0", ptr @"sa.static_pyarray.%tmp107.150c532c.0", ptr @"sa.static_pyarray.%tmp108.150c532c.0", ptr @"sa.static_pyarray.%tmp109.150c532c.0", ptr @"sa.static_pyarray.%tmp110.150c532c.0", ptr @"sa.static_pyarray.%tmp111.150c532c.0", ptr @"sa.static_pyarray.%tmp112.150c532c.0", ptr @"sa.static_pyarray.%tmp113.150c532c.0", ptr @"sa.static_pyarray.%tmp114.150c532c.0", ptr @"sa.static_pyarray.%tmp115.150c532c.0", ptr @"sa.static_pyarray.%tmp116.150c532c.0", ptr @"sa.static_pyarray.%tmp117.150c532c.0", ptr @"sa.static_pyarray.%tmp118.150c532c.0", ptr @"sa.static_pyarray.%tmp119.150c532c.0", ptr @"sa.static_pyarray.%tmp120.150c532c.0", ptr @"sa.static_pyarray.%tmp121.150c532c.0", ptr @"sa.static_pyarray.%tmp122.150c532c.0", ptr @"sa.static_pyarray.%tmp123.150c532c.0", ptr @"sa.static_pyarray.%tmp124.150c532c.0", ptr @"sa.static_pyarray.%tmp125.150c532c.0", ptr @"sa.static_pyarray.%tmp126.150c532c.0", ptr @"sa.static_pyarray.%tmp127.150c532c.0", ptr @"sa.static_pyarray.%tmp128.150c532c.0", ptr @"sa.static_pyarray.%tmp129.150c532c.0", ptr @"sa.static_pyarray.%tmp130.150c532c.0", ptr @"sa.static_pyarray.%tmp131.150c532c.0", ptr @"sa.static_pyarray.%tmp132.150c532c.0", ptr @"sa.static_pyarray.%tmp133.150c532c.0", ptr @"sa.static_pyarray.%tmp134.150c532c.0", ptr @"sa.static_pyarray.%tmp135.150c532c.0", ptr @"sa.static_pyarray.%tmp136.150c532c.0", ptr @"sa.static_pyarray.%tmp137.150c532c.0", ptr @"sa.static_pyarray.%tmp138.150c532c.0", ptr @"sa.static_pyarray.%tmp139.150c532c.0", ptr @"sa.static_pyarray.%tmp140.150c532c.0", ptr @"sa.static_pyarray.%tmp141.150c532c.0", ptr @"sa.static_pyarray.%tmp142.150c532c.0", ptr @"sa.static_pyarray.%tmp143.150c532c.0", ptr @"sa.static_pyarray.%tmp144.150c532c.0", ptr @"sa.static_pyarray.%tmp145.150c532c.0", ptr @"sa.static_pyarray.%tmp146.150c532c.0", ptr @"sa.static_pyarray.%tmp147.150c532c.0", ptr @"sa.static_pyarray.%tmp148.150c532c.0", ptr @"sa.static_pyarray.%tmp149.150c532c.0", ptr @"sa.static_pyarray.%tmp150.150c532c.0", ptr @"sa.static_pyarray.%tmp151.150c532c.0", ptr @"sa.static_pyarray.%tmp152.150c532c.0", ptr @"sa.static_pyarray.%tmp153.150c532c.0", ptr @"sa.static_pyarray.%tmp154.150c532c.0", ptr @"sa.static_pyarray.%tmp155.150c532c.0", ptr @"sa.static_pyarray.%tmp156.150c532c.0", ptr @"sa.static_pyarray.%tmp157.150c532c.0", ptr @"sa.static_pyarray.%tmp158.150c532c.0", ptr @"sa.static_pyarray.%tmp159.150c532c.0", ptr @"sa.static_pyarray.%tmp160.150c532c.0", ptr @"sa.static_pyarray.%tmp161.150c532c.0", ptr @"sa.static_pyarray.%tmp162.150c532c.0", ptr @"sa.static_pyarray.%tmp163.150c532c.0", ptr @"sa.static_pyarray.%tmp164.150c532c.0", ptr @"sa.static_pyarray.%tmp165.150c532c.0", ptr @"sa.static_pyarray.%tmp166.150c532c.0", ptr @"sa.static_pyarray.%tmp167.150c532c.0", ptr @"sa.static_pyarray.%tmp168.150c532c.0", ptr @"sa.static_pyarray.%tmp169.150c532c.0", ptr @"sa.static_pyarray.%tmp170.150c532c.0", ptr @"sa.static_pyarray.%tmp171.150c532c.0", ptr @"sa.static_pyarray.%tmp172.150c532c.0", ptr @"sa.static_pyarray.%tmp173.150c532c.0", ptr @"sa.static_pyarray.%tmp174.150c532c.0", ptr @"sa.static_pyarray.%tmp175.150c532c.0", ptr @"sa.static_pyarray.%tmp176.150c532c.0", ptr @"sa.static_pyarray.%tmp177.150c532c.0", ptr @"sa.static_pyarray.%tmp178.150c532c.0", ptr @"sa.static_pyarray.%tmp179.150c532c.0", ptr @"sa.static_pyarray.%tmp180.150c532c.0", ptr @"sa.static_pyarray.%tmp181.150c532c.0", ptr @"sa.static_pyarray.%tmp182.150c532c.0", ptr @"sa.static_pyarray.%tmp183.150c532c.0", ptr @"sa.static_pyarray.%tmp184.150c532c.0", ptr @"sa.static_pyarray.%tmp185.150c532c.0", ptr @"sa.static_pyarray.%tmp186.150c532c.0", ptr @"sa.static_pyarray.%tmp187.150c532c.0", ptr @"sa.static_pyarray.%tmp188.150c532c.0", ptr @"sa.static_pyarray.%tmp189.150c532c.0", ptr @"sa.static_pyarray.%tmp190.150c532c.0", ptr @"sa.static_pyarray.%tmp191.150c532c.0", ptr @"sa.static_pyarray.%tmp192.150c532c.0", ptr @"sa.static_pyarray.%tmp193.150c532c.0", ptr @"sa.static_pyarray.%tmp194.150c532c.0", ptr @"sa.static_pyarray.%tmp195.150c532c.0", ptr @"sa.static_pyarray.%tmp196.150c532c.0", ptr @"sa.static_pyarray.%tmp197.150c532c.0", ptr @"sa.static_pyarray.%tmp198.150c532c.0", ptr @"sa.static_pyarray.%tmp199.150c532c.0", ptr @"sa.static_pyarray.%tmp200.150c532c.0", ptr @"sa.static_pyarray.%tmp201.150c532c.0", ptr @"sa.static_pyarray.%tmp202.150c532c.0", ptr @"sa.static_pyarray.%tmp203.150c532c.0", ptr @"sa.static_pyarray.%tmp204.150c532c.0", ptr @"sa.static_pyarray.%tmp205.150c532c.0", ptr @"sa.static_pyarray.%tmp206.150c532c.0", ptr @"sa.static_pyarray.%tmp207.150c532c.0", ptr @"sa.static_pyarray.%tmp208.150c532c.0", ptr @"sa.static_pyarray.%tmp209.150c532c.0", ptr @"sa.static_pyarray.%tmp210.150c532c.0", ptr @"sa.static_pyarray.%tmp211.150c532c.0", ptr @"sa.static_pyarray.%tmp212.150c532c.0", ptr @"sa.static_pyarray.%tmp213.150c532c.0", ptr @"sa.static_pyarray.%tmp214.150c532c.0", ptr @"sa.static_pyarray.%tmp215.150c532c.0", ptr @"sa.static_pyarray.%tmp216.150c532c.0", ptr @"sa.static_pyarray.%tmp217.150c532c.0", ptr @"sa.static_pyarray.%tmp218.150c532c.0", ptr @"sa.static_pyarray.%tmp219.150c532c.0", ptr @"sa.static_pyarray.%tmp220.150c532c.0", ptr @"sa.static_pyarray.%tmp221.150c532c.0", ptr @"sa.static_pyarray.%tmp222.150c532c.0", ptr @"sa.static_pyarray.%tmp223.150c532c.0", ptr @"sa.static_pyarray.%tmp224.150c532c.0", ptr @"sa.static_pyarray.%tmp225.150c532c.0", ptr @"sa.static_pyarray.%tmp226.150c532c.0", ptr @"sa.static_pyarray.%tmp227.150c532c.0", ptr @"sa.static_pyarray.%tmp228.150c532c.0", ptr @"sa.static_pyarray.%tmp229.150c532c.0", ptr @"sa.static_pyarray.%tmp230.150c532c.0", ptr @"sa.static_pyarray.%tmp231.150c532c.0", ptr @"sa.static_pyarray.%tmp232.150c532c.0", ptr @"sa.static_pyarray.%tmp233.150c532c.0", ptr @"sa.static_pyarray.%tmp234.150c532c.0", ptr @"sa.static_pyarray.%tmp235.150c532c.0", ptr @"sa.static_pyarray.%tmp236.150c532c.0", ptr @"sa.static_pyarray.%tmp237.150c532c.0", ptr @"sa.static_pyarray.%tmp238.150c532c.0", ptr @"sa.static_pyarray.%tmp239.150c532c.0", ptr @"sa.static_pyarray.%tmp240.150c532c.0", ptr @"sa.static_pyarray.%tmp241.150c532c.0", ptr @"sa.static_pyarray.%tmp242.150c532c.0", ptr @"sa.static_pyarray.%tmp243.150c532c.0", ptr @"sa.static_pyarray.%tmp244.150c532c.0", ptr @"sa.static_pyarray.%tmp245.150c532c.0", ptr @"sa.static_pyarray.%tmp246.150c532c.0", ptr @"sa.static_pyarray.%tmp247.150c532c.0", ptr @"sa.static_pyarray.%tmp248.150c532c.0", ptr @"sa.static_pyarray.%tmp249.150c532c.0", ptr @"sa.static_pyarray.%tmp250.150c532c.0", ptr @"sa.static_pyarray.%tmp251.150c532c.0", ptr @"sa.static_pyarray.%tmp252.150c532c.0", ptr @"sa.static_pyarray.%tmp253.150c532c.0", ptr @"sa.static_pyarray.%tmp254.150c532c.0", ptr @"sa.static_pyarray.%tmp255.150c532c.0", ptr @"sa.static_pyarray.%tmp256.150c532c.0", ptr @"sa.static_pyarray.%tmp257.150c532c.0", ptr @"sa.static_pyarray.%tmp258.150c532c.0", ptr @"sa.static_pyarray.%tmp259.150c532c.0", ptr @"sa.static_pyarray.%tmp260.150c532c.0", ptr @"sa.static_pyarray.%tmp261.150c532c.0", ptr @"sa.static_pyarray.%tmp262.150c532c.0", ptr @"sa.static_pyarray.%tmp263.150c532c.0", ptr @"sa.static_pyarray.%tmp264.150c532c.0", ptr @"sa.static_pyarray.%tmp265.150c532c.0", ptr @"sa.static_pyarray.%tmp266.150c532c.0", ptr @"sa.static_pyarray.%tmp267.150c532c.0", ptr @"sa.static_pyarray.%tmp268.150c532c.0", ptr @"sa.static_pyarray.%tmp269.150c532c.0", ptr @"sa.static_pyarray.%tmp270.150c532c.0", ptr @"sa.static_pyarray.%tmp271.150c532c.0", ptr @"sa.static_pyarray.%tmp272.150c532c.0", ptr @"sa.static_pyarray.%tmp273.150c532c.0", ptr @"sa.static_pyarray.%tmp274.150c532c.0", ptr @"sa.static_pyarray.%tmp275.150c532c.0", ptr @"sa.static_pyarray.%tmp276.150c532c.0", ptr @"sa.static_pyarray.%tmp277.150c532c.0", ptr @"sa.static_pyarray.%tmp278.150c532c.0", ptr @"sa.static_pyarray.%tmp279.150c532c.0", ptr @"sa.static_pyarray.%tmp280.150c532c.0", ptr @"sa.static_pyarray.%tmp281.150c532c.0", ptr @"sa.static_pyarray.%tmp282.150c532c.0", ptr @"sa.static_pyarray.%tmp283.150c532c.0", ptr @"sa.static_pyarray.%tmp284.150c532c.0", ptr @"sa.static_pyarray.%tmp285.150c532c.0", ptr @"sa.static_pyarray.%tmp286.150c532c.0", ptr @"sa.static_pyarray.%tmp287.150c532c.0", ptr @"sa.static_pyarray.%tmp288.150c532c.0", ptr @"sa.static_pyarray.%tmp289.150c532c.0", ptr @"sa.static_pyarray.%tmp290.150c532c.0", ptr @"sa.static_pyarray.%tmp291.150c532c.0", ptr @"sa.static_pyarray.%tmp292.150c532c.0", ptr @"sa.static_pyarray.%tmp293.150c532c.0", ptr @"sa.static_pyarray.%tmp294.150c532c.0", ptr @"sa.static_pyarray.%tmp295.150c532c.0", ptr @"sa.static_pyarray.%tmp296.150c532c.0", ptr @"sa.static_pyarray.%tmp297.150c532c.0", ptr @"sa.static_pyarray.%tmp298.150c532c.0", ptr @"sa.static_pyarray.%tmp299.150c532c.0", ptr @"sa.static_pyarray.%tmp300.150c532c.0", ptr @"sa.static_pyarray.%tmp301.150c532c.0", ptr @"sa.static_pyarray.%tmp302.150c532c.0", ptr @"sa.static_pyarray.%tmp303.150c532c.0", ptr @"sa.static_pyarray.%tmp304.150c532c.0", ptr @"sa.static_pyarray.%tmp305.150c532c.0", ptr @"sa.static_pyarray.%tmp306.150c532c.0", ptr @"sa.static_pyarray.%tmp307.150c532c.0", ptr @"sa.static_pyarray.%tmp308.150c532c.0", ptr @"sa.static_pyarray.%tmp309.150c532c.0", ptr @"sa.static_pyarray.%tmp310.150c532c.0", ptr @"sa.static_pyarray.%tmp311.150c532c.0", ptr @"sa.static_pyarray.%tmp312.150c532c.0", ptr @"sa.static_pyarray.%tmp313.150c532c.0", ptr @"sa.static_pyarray.%tmp314.150c532c.0", ptr @"sa.static_pyarray.%tmp315.150c532c.0", ptr @"sa.static_pyarray.%tmp316.150c532c.0", ptr @"sa.static_pyarray.%tmp317.150c532c.0", ptr @"sa.static_pyarray.%tmp318.150c532c.0", ptr @"sa.static_pyarray.%tmp319.150c532c.0", ptr @"sa.static_pyarray.%tmp320.150c532c.0", ptr @"sa.static_pyarray.%tmp321.150c532c.0", ptr @"sa.static_pyarray.%tmp322.150c532c.0", ptr @"sa.static_pyarray.%tmp323.150c532c.0", ptr @"sa.static_pyarray.%tmp324.150c532c.0", ptr @"sa.static_pyarray.%tmp325.150c532c.0", ptr @"sa.static_pyarray.%tmp326.150c532c.0", ptr @"sa.static_pyarray.%tmp327.150c532c.0", ptr @"sa.static_pyarray.%tmp328.150c532c.0", ptr @"sa.static_pyarray.%tmp329.150c532c.0", ptr @"sa.static_pyarray.%tmp330.150c532c.0", ptr @"sa.static_pyarray.%tmp331.150c532c.0", ptr @"sa.static_pyarray.%tmp332.150c532c.0", ptr @"sa.static_pyarray.%tmp333.150c532c.0", ptr @"sa.static_pyarray.%tmp334.150c532c.0", ptr @"sa.static_pyarray.%tmp335.150c532c.0", ptr @"sa.static_pyarray.%tmp336.150c532c.0", ptr @"sa.static_pyarray.%tmp337.150c532c.0", ptr @"sa.static_pyarray.%tmp338.150c532c.0", ptr @"sa.static_pyarray.%tmp339.150c532c.0", ptr @"sa.static_pyarray.%tmp340.150c532c.0", ptr @"sa.static_pyarray.%tmp341.150c532c.0", ptr @"sa.static_pyarray.%tmp342.150c532c.0", ptr @"sa.static_pyarray.%tmp343.150c532c.0", ptr @"sa.static_pyarray.%tmp344.150c532c.0", ptr @"sa.static_pyarray.%tmp345.150c532c.0", ptr @"sa.static_pyarray.%tmp346.150c532c.0", ptr @"sa.static_pyarray.%tmp347.150c532c.0", ptr @"sa.static_pyarray.%tmp348.150c532c.0", ptr @"sa.static_pyarray.%tmp349.150c532c.0", ptr @"sa.static_pyarray.%tmp350.150c532c.0", ptr @"sa.static_pyarray.%tmp351.150c532c.0", ptr @"sa.static_pyarray.%tmp352.150c532c.0", ptr @"sa.static_pyarray.%tmp353.150c532c.0", ptr @"sa.static_pyarray.%tmp354.150c532c.0", ptr @"sa.static_pyarray.%tmp355.150c532c.0", ptr @"sa.static_pyarray.%tmp356.150c532c.0", ptr @"sa.static_pyarray.%tmp357.150c532c.0", ptr @"sa.static_pyarray.%tmp358.150c532c.0", ptr @"sa.static_pyarray.%tmp359.150c532c.0", ptr @"sa.static_pyarray.%tmp360.150c532c.0", ptr @"sa.static_pyarray.%tmp361.150c532c.0", ptr @"sa.static_pyarray.%tmp362.150c532c.0", ptr @"sa.static_pyarray.%tmp363.150c532c.0", ptr @"sa.static_pyarray.%tmp364.150c532c.0", ptr @"sa.static_pyarray.%tmp365.150c532c.0", ptr @"sa.static_pyarray.%tmp366.150c532c.0", ptr @"sa.static_pyarray.%tmp367.150c532c.0", ptr @"sa.static_pyarray.%tmp368.150c532c.0", ptr @"sa.static_pyarray.%tmp369.150c532c.0", ptr @"sa.static_pyarray.%tmp370.150c532c.0", ptr @"sa.static_pyarray.%tmp371.150c532c.0", ptr @"sa.static_pyarray.%tmp372.150c532c.0", ptr @"sa.static_pyarray.%tmp373.150c532c.0", ptr @"sa.static_pyarray.%tmp374.150c532c.0", ptr @"sa.static_pyarray.%tmp375.150c532c.0", ptr @"sa.static_pyarray.%tmp376.150c532c.0", ptr @"sa.static_pyarray.%tmp377.150c532c.0", ptr @"sa.static_pyarray.%tmp378.150c532c.0", ptr @"sa.static_pyarray.%tmp379.150c532c.0", ptr @"sa.static_pyarray.%tmp380.150c532c.0", ptr @"sa.static_pyarray.%tmp381.150c532c.0", ptr @"sa.static_pyarray.%tmp382.150c532c.0", ptr @"sa.static_pyarray.%tmp383.150c532c.0", ptr @"sa.static_pyarray.%tmp384.150c532c.0", ptr @"sa.static_pyarray.%tmp385.150c532c.0", ptr @"sa.static_pyarray.%tmp386.150c532c.0", ptr @"sa.static_pyarray.%tmp387.150c532c.0", ptr @"sa.static_pyarray.%tmp388.150c532c.0", ptr @"sa.static_pyarray.%tmp389.150c532c.0", ptr @"sa.static_pyarray.%tmp390.150c532c.0", ptr @"sa.static_pyarray.%tmp391.150c532c.0", ptr @"sa.static_pyarray.%tmp392.150c532c.0", ptr @"sa.static_pyarray.%tmp393.150c532c.0", ptr @"sa.static_pyarray.%tmp394.150c532c.0", ptr @"sa.static_pyarray.%tmp395.150c532c.0", ptr @"sa.static_pyarray.%tmp396.150c532c.0", ptr @"sa.static_pyarray.%tmp397.150c532c.0", ptr @"sa.static_pyarray.%tmp398.150c532c.0", ptr @"sa.static_pyarray.%tmp399.150c532c.0", ptr @"sa.static_pyarray.%tmp400.150c532c.0", ptr @"sa.static_pyarray.%tmp401.150c532c.0", ptr @"sa.static_pyarray.%tmp402.150c532c.0", ptr @"sa.static_pyarray.%tmp403.150c532c.0", ptr @"sa.static_pyarray.%tmp404.150c532c.0", ptr @"sa.static_pyarray.%tmp405.150c532c.0", ptr @"sa.static_pyarray.%tmp406.150c532c.0", ptr @"sa.static_pyarray.%tmp407.150c532c.0", ptr @"sa.static_pyarray.%tmp408.150c532c.0", ptr @"sa.static_pyarray.%tmp409.150c532c.0", ptr @"sa.static_pyarray.%tmp410.150c532c.0", ptr @"sa.static_pyarray.%tmp411.150c532c.0", ptr @"sa.static_pyarray.%tmp412.150c532c.0", ptr @"sa.static_pyarray.%tmp413.150c532c.0", ptr @"sa.static_pyarray.%tmp414.150c532c.0", ptr @"sa.static_pyarray.%tmp415.150c532c.0", ptr @"sa.static_pyarray.%tmp416.150c532c.0", ptr @"sa.static_pyarray.%tmp417.150c532c.0", ptr @"sa.static_pyarray.%tmp418.150c532c.0", ptr @"sa.static_pyarray.%tmp419.150c532c.0", ptr @"sa.static_pyarray.%tmp420.150c532c.0", ptr @"sa.static_pyarray.%tmp421.150c532c.0", ptr @"sa.static_pyarray.%tmp422.150c532c.0", ptr @"sa.static_pyarray.%tmp423.150c532c.0", ptr @"sa.static_pyarray.%tmp424.150c532c.0", ptr @"sa.static_pyarray.%tmp425.150c532c.0", ptr @"sa.static_pyarray.%tmp426.150c532c.0", ptr @"sa.static_pyarray.%tmp427.150c532c.0", ptr @"sa.static_pyarray.%tmp428.150c532c.0", ptr @"sa.static_pyarray.%tmp429.150c532c.0", ptr @"sa.static_pyarray.%tmp430.150c532c.0", ptr @"sa.static_pyarray.%tmp431.150c532c.0", ptr @"sa.static_pyarray.%tmp432.150c532c.0", ptr @"sa.static_pyarray.%tmp433.150c532c.0", ptr @"sa.static_pyarray.%tmp434.150c532c.0", ptr @"sa.static_pyarray.%tmp435.150c532c.0", ptr @"sa.static_pyarray.%tmp436.150c532c.0", ptr @"sa.static_pyarray.%tmp437.150c532c.0", ptr @"sa.static_pyarray.%tmp438.150c532c.0", ptr @"sa.static_pyarray.%tmp439.150c532c.0", ptr @"sa.static_pyarray.%tmp440.150c532c.0", ptr @"sa.static_pyarray.%tmp441.150c532c.0", ptr @"sa.static_pyarray.%tmp442.150c532c.0", ptr @"sa.static_pyarray.%tmp443.150c532c.0", ptr @"sa.static_pyarray.%tmp444.150c532c.0", ptr @"sa.static_pyarray.%tmp445.150c532c.0", ptr @"sa.static_pyarray.%tmp446.150c532c.0", ptr @"sa.static_pyarray.%tmp447.150c532c.0", ptr @"sa.static_pyarray.%tmp448.150c532c.0", ptr @"sa.static_pyarray.%tmp449.150c532c.0", ptr @"sa.static_pyarray.%tmp450.150c532c.0", ptr @"sa.static_pyarray.%tmp451.150c532c.0", ptr @"sa.static_pyarray.%tmp452.150c532c.0", ptr @"sa.static_pyarray.%tmp453.150c532c.0", ptr @"sa.static_pyarray.%tmp454.150c532c.0", ptr @"sa.static_pyarray.%tmp455.150c532c.0", ptr @"sa.static_pyarray.%tmp456.150c532c.0", ptr @"sa.static_pyarray.%tmp457.150c532c.0", ptr @"sa.static_pyarray.%tmp458.150c532c.0", ptr @"sa.static_pyarray.%tmp459.150c532c.0", ptr @"sa.static_pyarray.%tmp460.150c532c.0", ptr @"sa.static_pyarray.%tmp461.150c532c.0", ptr @"sa.static_pyarray.%tmp462.150c532c.0", ptr @"sa.static_pyarray.%tmp463.150c532c.0", ptr @"sa.static_pyarray.%tmp464.150c532c.0", ptr @"sa.static_pyarray.%tmp465.150c532c.0", ptr @"sa.static_pyarray.%tmp466.150c532c.0", ptr @"sa.static_pyarray.%tmp467.150c532c.0", ptr @"sa.static_pyarray.%tmp468.150c532c.0", ptr @"sa.static_pyarray.%tmp469.150c532c.0", ptr @"sa.static_pyarray.%tmp470.150c532c.0", ptr @"sa.static_pyarray.%tmp471.150c532c.0", ptr @"sa.static_pyarray.%tmp472.150c532c.0", ptr @"sa.static_pyarray.%tmp473.150c532c.0", ptr @"sa.static_pyarray.%tmp474.150c532c.0", ptr @"sa.static_pyarray.%tmp475.150c532c.0", ptr @"sa.static_pyarray.%tmp476.150c532c.0", ptr @"sa.static_pyarray.%tmp477.150c532c.0", ptr @"sa.static_pyarray.%tmp478.150c532c.0", ptr @"sa.static_pyarray.%tmp479.150c532c.0", ptr @"sa.static_pyarray.%tmp480.150c532c.0", ptr @"sa.static_pyarray.%tmp481.150c532c.0", ptr @"sa.static_pyarray.%tmp482.150c532c.0", ptr @"sa.static_pyarray.%tmp483.150c532c.0", ptr @"sa.static_pyarray.%tmp484.150c532c.0", ptr @"sa.static_pyarray.%tmp485.150c532c.0", ptr @"sa.static_pyarray.%tmp486.150c532c.0", ptr @"sa.static_pyarray.%tmp487.150c532c.0", ptr @"sa.static_pyarray.%tmp488.150c532c.0", ptr @"sa.static_pyarray.%tmp489.150c532c.0", ptr @"sa.static_pyarray.%tmp490.150c532c.0", ptr @"sa.static_pyarray.%tmp491.150c532c.0", ptr @"sa.static_pyarray.%tmp492.150c532c.0", ptr @"sa.static_pyarray.%tmp493.150c532c.0", ptr @"sa.static_pyarray.%tmp494.150c532c.0", ptr @"sa.static_pyarray.%tmp495.150c532c.0", ptr @"sa.static_pyarray.%tmp496.150c532c.0", ptr @"sa.static_pyarray.%tmp497.150c532c.0", ptr @"sa.static_pyarray.%tmp498.150c532c.0", ptr @"sa.static_pyarray.%tmp499.150c532c.0", ptr @"sa.static_pyarray.%tmp500.150c532c.0", ptr @"sa.static_pyarray.%tmp501.150c532c.0", ptr @"sa.static_pyarray.%tmp502.150c532c.0", ptr @"sa.static_pyarray.%tmp503.150c532c.0", ptr @"sa.static_pyarray.%tmp504.150c532c.0", ptr @"sa.static_pyarray.%tmp505.150c532c.0", ptr @"sa.static_pyarray.%tmp506.150c532c.0", ptr @"sa.static_pyarray.%tmp507.150c532c.0", ptr @"sa.static_pyarray.%tmp508.150c532c.0", ptr @"sa.static_pyarray.%tmp509.150c532c.0", ptr @"sa.static_pyarray.%tmp510.150c532c.0", ptr @"sa.static_pyarray.%tmp511.150c532c.0", ptr @"sa.static_pyarray.%tmp512.150c532c.0", ptr @"sa.static_pyarray.%tmp513.150c532c.0", ptr @"sa.static_pyarray.%tmp514.150c532c.0", ptr @"sa.static_pyarray.%tmp515.150c532c.0", ptr @"sa.static_pyarray.%tmp516.150c532c.0", ptr @"sa.static_pyarray.%tmp517.150c532c.0", ptr @"sa.static_pyarray.%tmp518.150c532c.0", ptr @"sa.static_pyarray.%tmp519.150c532c.0", ptr @"sa.static_pyarray.%tmp520.150c532c.0", ptr @"sa.static_pyarray.%tmp521.150c532c.0", ptr @"sa.static_pyarray.%tmp522.150c532c.0", ptr @"sa.static_pyarray.%tmp523.150c532c.0", ptr @"sa.static_pyarray.%tmp524.150c532c.0", ptr @"sa.static_pyarray.%tmp525.150c532c.0", ptr @"sa.static_pyarray.%tmp526.150c532c.0", ptr @"sa.static_pyarray.%tmp527.150c532c.0", ptr @"sa.static_pyarray.%tmp528.150c532c.0", ptr @"sa.static_pyarray.%tmp529.150c532c.0", ptr @"sa.static_pyarray.%tmp530.150c532c.0", ptr @"sa.static_pyarray.%tmp531.150c532c.0", ptr @"sa.static_pyarray.%tmp532.150c532c.0", ptr @"sa.static_pyarray.%tmp533.150c532c.0", ptr @"sa.static_pyarray.%tmp534.150c532c.0", ptr @"sa.static_pyarray.%tmp535.150c532c.0", ptr @"sa.static_pyarray.%tmp536.150c532c.0", ptr @"sa.static_pyarray.%tmp537.150c532c.0", ptr @"sa.static_pyarray.%tmp538.150c532c.0", ptr @"sa.static_pyarray.%tmp539.150c532c.0", ptr @"sa.static_pyarray.%tmp540.150c532c.0", ptr @"sa.static_pyarray.%tmp541.150c532c.0", ptr @"sa.static_pyarray.%tmp542.150c532c.0", ptr @"sa.static_pyarray.%tmp543.150c532c.0", ptr @"sa.static_pyarray.%tmp544.150c532c.0", ptr @"sa.static_pyarray.%tmp545.150c532c.0", ptr @"sa.static_pyarray.%tmp546.150c532c.0", ptr @"sa.static_pyarray.%tmp547.150c532c.0", ptr @"sa.static_pyarray.%tmp548.150c532c.0", ptr @"sa.static_pyarray.%tmp549.150c532c.0", ptr @"sa.static_pyarray.%tmp550.150c532c.0", ptr @"sa.static_pyarray.%tmp551.150c532c.0", ptr @"sa.static_pyarray.%tmp552.150c532c.0", ptr @"sa.static_pyarray.%tmp553.150c532c.0", ptr @"sa.static_pyarray.%tmp554.150c532c.0", ptr @"sa.static_pyarray.%tmp555.150c532c.0", ptr @"sa.static_pyarray.%tmp556.150c532c.0", ptr @"sa.static_pyarray.%tmp557.150c532c.0", ptr @"sa.static_pyarray.%tmp558.150c532c.0", ptr @"sa.static_pyarray.%tmp559.150c532c.0", ptr @"sa.static_pyarray.%tmp560.150c532c.0", ptr @"sa.static_pyarray.%tmp561.150c532c.0", ptr @"sa.static_pyarray.%tmp562.150c532c.0", ptr @"sa.static_pyarray.%tmp563.150c532c.0", ptr @"sa.static_pyarray.%tmp564.150c532c.0", ptr @"sa.static_pyarray.%tmp565.150c532c.0", ptr @"sa.static_pyarray.%tmp566.150c532c.0", ptr @"sa.static_pyarray.%tmp567.150c532c.0", ptr @"sa.static_pyarray.%tmp568.150c532c.0", ptr @"sa.static_pyarray.%tmp569.150c532c.0", ptr @"sa.static_pyarray.%tmp570.150c532c.0", ptr @"sa.static_pyarray.%tmp571.150c532c.0", ptr @"sa.static_pyarray.%tmp572.150c532c.0", ptr @"sa.static_pyarray.%tmp573.150c532c.0", ptr @"sa.static_pyarray.%tmp574.150c532c.0", ptr @"sa.static_pyarray.%tmp575.150c532c.0", ptr @"sa.static_pyarray.%tmp576.150c532c.0", ptr @"sa.static_pyarray.%tmp577.150c532c.0", ptr @"sa.static_pyarray.%tmp578.150c532c.0", ptr @"sa.static_pyarray.%tmp579.150c532c.0", ptr @"sa.static_pyarray.%tmp580.150c532c.0", ptr @"sa.static_pyarray.%tmp581.150c532c.0", ptr @"sa.static_pyarray.%tmp582.150c532c.0", ptr @"sa.static_pyarray.%tmp583.150c532c.0", ptr @"sa.static_pyarray.%tmp584.150c532c.0", ptr @"sa.static_pyarray.%tmp585.150c532c.0", ptr @"sa.static_pyarray.%tmp586.150c532c.0", ptr @"sa.static_pyarray.%tmp587.150c532c.0", ptr @"sa.static_pyarray.%tmp588.150c532c.0", ptr @"sa.static_pyarray.%tmp589.150c532c.0", ptr @"sa.static_pyarray.%tmp590.150c532c.0", ptr @"sa.static_pyarray.%tmp591.150c532c.0", ptr @"sa.static_pyarray.%tmp592.150c532c.0", ptr @"sa.static_pyarray.%tmp593.150c532c.0", ptr @"sa.static_pyarray.%tmp594.150c532c.0", ptr @"sa.static_pyarray.%tmp595.150c532c.0", ptr @"sa.static_pyarray.%tmp596.150c532c.0", ptr @"sa.static_pyarray.%tmp597.150c532c.0", ptr @"sa.static_pyarray.%tmp598.150c532c.0", ptr @"sa.static_pyarray.%tmp599.150c532c.0", ptr @"sa.static_pyarray.%tmp600.150c532c.0", ptr @"sa.static_pyarray.%tmp601.150c532c.0", ptr @"sa.static_pyarray.%tmp602.150c532c.0", ptr @"sa.static_pyarray.%tmp603.150c532c.0", ptr @"sa.static_pyarray.%tmp604.150c532c.0", ptr @"sa.static_pyarray.%tmp605.150c532c.0", ptr @"sa.static_pyarray.%tmp606.150c532c.0", ptr @"sa.static_pyarray.%tmp607.150c532c.0", ptr @"sa.static_pyarray.%tmp608.150c532c.0", ptr @"sa.static_pyarray.%tmp609.150c532c.0", ptr @"sa.static_pyarray.%tmp610.150c532c.0", ptr @"sa.static_pyarray.%tmp611.150c532c.0", ptr @"sa.static_pyarray.%tmp612.150c532c.0", ptr @"sa.static_pyarray.%tmp613.150c532c.0", ptr @"sa.static_pyarray.%tmp614.150c532c.0", ptr @"sa.static_pyarray.%tmp615.150c532c.0", ptr @"sa.static_pyarray.%tmp616.150c532c.0", ptr @"sa.static_pyarray.%tmp617.150c532c.0", ptr @"sa.static_pyarray.%tmp618.150c532c.0", ptr @"sa.static_pyarray.%tmp619.150c532c.0", ptr @"sa.static_pyarray.%tmp620.150c532c.0", ptr @"sa.static_pyarray.%tmp621.150c532c.0", ptr @"sa.static_pyarray.%tmp622.150c532c.0", ptr @"sa.static_pyarray.%tmp623.150c532c.0", ptr @"sa.static_pyarray.%tmp624.150c532c.0", ptr @"sa.static_pyarray.%tmp625.150c532c.0", ptr @"sa.static_pyarray.%tmp626.150c532c.0", ptr @"sa.static_pyarray.%tmp627.150c532c.0", ptr @"sa.static_pyarray.%tmp628.150c532c.0", ptr @"sa.static_pyarray.%tmp629.150c532c.0", ptr @"sa.static_pyarray.%tmp630.150c532c.0", ptr @"sa.static_pyarray.%tmp631.150c532c.0", ptr @"sa.static_pyarray.%tmp632.150c532c.0", ptr @"sa.static_pyarray.%tmp633.150c532c.0", ptr @"sa.static_pyarray.%tmp634.150c532c.0", ptr @"sa.static_pyarray.%tmp635.150c532c.0", ptr @"sa.static_pyarray.%tmp636.150c532c.0", ptr @"sa.static_pyarray.%tmp637.150c532c.0", ptr @"sa.static_pyarray.%tmp638.150c532c.0", ptr @"sa.static_pyarray.%tmp639.150c532c.0", ptr @"sa.static_pyarray.%tmp640.150c532c.0", ptr @"sa.static_pyarray.%tmp641.150c532c.0", ptr @"sa.static_pyarray.%tmp642.150c532c.0", ptr @"sa.static_pyarray.%tmp643.150c532c.0", ptr @"sa.static_pyarray.%tmp644.150c532c.0", ptr @"sa.static_pyarray.%tmp645.150c532c.0", ptr @"sa.static_pyarray.%tmp646.150c532c.0", ptr @"sa.static_pyarray.%tmp647.150c532c.0", ptr @"sa.static_pyarray.%tmp648.150c532c.0", ptr @"sa.static_pyarray.%tmp649.150c532c.0", ptr @"sa.static_pyarray.%tmp650.150c532c.0", ptr @"sa.static_pyarray.%tmp651.150c532c.0", ptr @"sa.static_pyarray.%tmp652.150c532c.0", ptr @"sa.static_pyarray.%tmp653.150c532c.0", ptr @"sa.static_pyarray.%tmp654.150c532c.0", ptr @"sa.static_pyarray.%tmp655.150c532c.0", ptr @"sa.static_pyarray.%tmp656.150c532c.0", ptr @"sa.static_pyarray.%tmp657.150c532c.0", ptr @"sa.static_pyarray.%tmp658.150c532c.0", ptr @"sa.static_pyarray.%tmp659.150c532c.0", ptr @"sa.static_pyarray.%tmp660.150c532c.0", ptr @"sa.static_pyarray.%tmp661.150c532c.0", ptr @"sa.static_pyarray.%tmp662.150c532c.0", ptr @"sa.static_pyarray.%tmp663.150c532c.0", ptr @"sa.static_pyarray.%tmp664.150c532c.0", ptr @"sa.static_pyarray.%tmp665.150c532c.0", ptr @"sa.static_pyarray.%tmp666.150c532c.0", ptr @"sa.static_pyarray.%tmp667.150c532c.0", ptr @"sa.static_pyarray.%tmp668.150c532c.0", ptr @"sa.static_pyarray.%tmp669.150c532c.0", ptr @"sa.static_pyarray.%tmp670.150c532c.0", ptr @"sa.static_pyarray.%tmp671.150c532c.0", ptr @"sa.static_pyarray.%tmp672.150c532c.0", ptr @"sa.static_pyarray.%tmp673.150c532c.0", ptr @"sa.static_pyarray.%tmp674.150c532c.0", ptr @"sa.static_pyarray.%tmp675.150c532c.0", ptr @"sa.static_pyarray.%tmp676.150c532c.0", ptr @"sa.static_pyarray.%tmp677.150c532c.0", ptr @"sa.static_pyarray.%tmp678.150c532c.0", ptr @"sa.static_pyarray.%tmp679.150c532c.0", ptr @"sa.static_pyarray.%tmp680.150c532c.0", ptr @"sa.static_pyarray.%tmp681.150c532c.0", ptr @"sa.static_pyarray.%tmp682.150c532c.0", ptr @"sa.static_pyarray.%tmp683.150c532c.0", ptr @"sa.static_pyarray.%tmp684.150c532c.0", ptr @"sa.static_pyarray.%tmp685.150c532c.0", ptr @"sa.static_pyarray.%tmp686.150c532c.0", ptr @"sa.static_pyarray.%tmp687.150c532c.0", ptr @"sa.static_pyarray.%tmp688.150c532c.0", ptr @"sa.static_pyarray.%tmp689.150c532c.0", ptr @"sa.static_pyarray.%tmp690.150c532c.0", ptr @"sa.static_pyarray.%tmp691.150c532c.0", ptr @"sa.static_pyarray.%tmp692.150c532c.0", ptr @"sa.static_pyarray.%tmp693.150c532c.0", ptr @"sa.static_pyarray.%tmp694.150c532c.0", ptr @"sa.static_pyarray.%tmp695.150c532c.0", ptr @"sa.static_pyarray.%tmp696.150c532c.0", ptr @"sa.static_pyarray.%tmp697.150c532c.0", ptr @"sa.static_pyarray.%tmp698.150c532c.0", ptr @"sa.static_pyarray.%tmp699.150c532c.0", ptr @"sa.static_pyarray.%tmp700.150c532c.0", ptr @"sa.static_pyarray.%tmp701.150c532c.0", ptr @"sa.static_pyarray.%tmp702.150c532c.0", ptr @"sa.static_pyarray.%tmp703.150c532c.0", ptr @"sa.static_pyarray.%tmp704.150c532c.0", ptr @"sa.static_pyarray.%tmp705.150c532c.0", ptr @"sa.static_pyarray.%tmp706.150c532c.0", ptr @"sa.static_pyarray.%tmp707.150c532c.0", ptr @"sa.static_pyarray.%tmp708.150c532c.0", ptr @"sa.static_pyarray.%tmp709.150c532c.0", ptr @"sa.static_pyarray.%tmp710.150c532c.0", ptr @"sa.static_pyarray.%tmp711.150c532c.0", ptr @"sa.static_pyarray.%tmp712.150c532c.0", ptr @"sa.static_pyarray.%tmp713.150c532c.0", ptr @"sa.static_pyarray.%tmp714.150c532c.0", ptr @"sa.static_pyarray.%tmp715.150c532c.0", ptr @"sa.static_pyarray.%tmp716.150c532c.0", ptr @"sa.static_pyarray.%tmp717.150c532c.0", ptr @"sa.static_pyarray.%tmp718.150c532c.0", ptr @"sa.static_pyarray.%tmp719.150c532c.0", ptr @"sa.static_pyarray.%tmp720.150c532c.0", ptr @"sa.static_pyarray.%tmp721.150c532c.0", ptr @"sa.static_pyarray.%tmp722.150c532c.0", ptr @"sa.static_pyarray.%tmp723.150c532c.0", ptr @"sa.static_pyarray.%tmp724.150c532c.0", ptr @"sa.static_pyarray.%tmp725.150c532c.0", ptr @"sa.static_pyarray.%tmp726.150c532c.0", ptr @"sa.static_pyarray.%tmp727.150c532c.0", ptr @"sa.static_pyarray.%tmp728.150c532c.0", ptr @"sa.static_pyarray.%tmp729.150c532c.0", ptr @"sa.static_pyarray.%tmp730.150c532c.0", ptr @"sa.static_pyarray.%tmp731.150c532c.0", ptr @"sa.static_pyarray.%tmp732.150c532c.0", ptr @"sa.static_pyarray.%tmp733.150c532c.0", ptr @"sa.static_pyarray.%tmp734.150c532c.0", ptr @"sa.static_pyarray.%tmp735.150c532c.0", ptr @"sa.static_pyarray.%tmp736.150c532c.0", ptr @"sa.static_pyarray.%tmp737.150c532c.0", ptr @"sa.static_pyarray.%tmp738.150c532c.0", ptr @"sa.static_pyarray.%tmp739.150c532c.0", ptr @"sa.static_pyarray.%tmp740.150c532c.0", ptr @"sa.static_pyarray.%tmp741.150c532c.0", ptr @"sa.static_pyarray.%tmp742.150c532c.0", ptr @"sa.static_pyarray.%tmp743.150c532c.0", ptr @"sa.static_pyarray.%tmp744.150c532c.0", ptr @"sa.static_pyarray.%tmp745.150c532c.0", ptr @"sa.static_pyarray.%tmp746.150c532c.0", ptr @"sa.static_pyarray.%tmp747.150c532c.0", ptr @"sa.static_pyarray.%tmp748.150c532c.0", ptr @"sa.static_pyarray.%tmp749.150c532c.0", ptr @"sa.static_pyarray.%tmp750.150c532c.0", ptr @"sa.static_pyarray.%tmp751.150c532c.0", ptr @"sa.static_pyarray.%tmp752.150c532c.0", ptr @"sa.static_pyarray.%tmp753.150c532c.0", ptr @"sa.static_pyarray.%tmp754.150c532c.0", ptr @"sa.static_pyarray.%tmp755.150c532c.0", ptr @"sa.static_pyarray.%tmp756.150c532c.0", ptr @"sa.static_pyarray.%tmp757.150c532c.0", ptr @"sa.static_pyarray.%tmp758.150c532c.0", ptr @"sa.static_pyarray.%tmp759.150c532c.0", ptr @"sa.static_pyarray.%tmp760.150c532c.0", ptr @"sa.static_pyarray.%tmp761.150c532c.0", ptr @"sa.static_pyarray.%tmp762.150c532c.0", ptr @"sa.static_pyarray.%tmp763.150c532c.0", ptr @"sa.static_pyarray.%tmp764.150c532c.0", ptr @"sa.static_pyarray.%tmp765.150c532c.0", ptr @"sa.static_pyarray.%tmp766.150c532c.0", ptr @"sa.static_pyarray.%tmp767.150c532c.0", ptr @"sa.static_pyarray.%tmp768.150c532c.0", ptr @"sa.static_pyarray.%tmp769.150c532c.0", ptr @"sa.static_pyarray.%tmp770.150c532c.0", ptr @"sa.static_pyarray.%tmp771.150c532c.0", ptr @"sa.static_pyarray.%tmp772.150c532c.0", ptr @"sa.static_pyarray.%tmp773.150c532c.0", ptr @"sa.static_pyarray.%tmp774.150c532c.0", ptr @"sa.static_pyarray.%tmp775.150c532c.0", ptr @"sa.static_pyarray.%tmp776.150c532c.0", ptr @"sa.static_pyarray.%tmp777.150c532c.0", ptr @"sa.static_pyarray.%tmp778.150c532c.0", ptr @"sa.static_pyarray.%tmp779.150c532c.0", ptr @"sa.static_pyarray.%tmp780.150c532c.0", ptr @"sa.static_pyarray.%tmp781.150c532c.0", ptr @"sa.static_pyarray.%tmp782.150c532c.0", ptr @"sa.static_pyarray.%tmp783.150c532c.0", ptr @"sa.static_pyarray.%tmp784.150c532c.0", ptr @"sa.static_pyarray.%tmp785.150c532c.0", ptr @"sa.static_pyarray.%tmp786.150c532c.0", ptr @"sa.static_pyarray.%tmp787.150c532c.0", ptr @"sa.static_pyarray.%tmp788.150c532c.0", ptr @"sa.static_pyarray.%tmp789.150c532c.0", ptr @"sa.static_pyarray.%tmp790.150c532c.0", ptr @"sa.static_pyarray.%tmp791.150c532c.0", ptr @"sa.static_pyarray.%tmp792.150c532c.0", ptr @"sa.static_pyarray.%tmp793.150c532c.0", ptr @"sa.static_pyarray.%tmp794.150c532c.0", ptr @"sa.static_pyarray.%tmp795.150c532c.0", ptr @"sa.static_pyarray.%tmp796.150c532c.0", ptr @"sa.static_pyarray.%tmp797.150c532c.0", ptr @"sa.static_pyarray.%tmp798.150c532c.0", ptr @"sa.static_pyarray.%tmp799.150c532c.0", ptr @"sa.static_pyarray.%tmp800.150c532c.0", ptr @"sa.static_pyarray.%tmp801.150c532c.0", ptr @"sa.static_pyarray.%tmp802.150c532c.0", ptr @"sa.static_pyarray.%tmp803.150c532c.0", ptr @"sa.static_pyarray.%tmp804.150c532c.0", ptr @"sa.static_pyarray.%tmp805.150c532c.0", ptr @"sa.static_pyarray.%tmp806.150c532c.0", ptr @"sa.static_pyarray.%tmp807.150c532c.0", ptr @"sa.static_pyarray.%tmp808.150c532c.0", ptr @"sa.static_pyarray.%tmp809.150c532c.0", ptr @"sa.static_pyarray.%tmp810.150c532c.0", ptr @"sa.static_pyarray.%tmp811.150c532c.0", ptr @"sa.static_pyarray.%tmp812.150c532c.0", ptr @"sa.static_pyarray.%tmp813.150c532c.0", ptr @"sa.static_pyarray.%tmp814.150c532c.0", ptr @"sa.static_pyarray.%tmp815.150c532c.0", ptr @"sa.static_pyarray.%tmp816.150c532c.0", ptr @"sa.static_pyarray.%tmp817.150c532c.0", ptr @"sa.static_pyarray.%tmp818.150c532c.0", ptr @"sa.static_pyarray.%tmp819.150c532c.0", ptr @"sa.static_pyarray.%tmp820.150c532c.0", ptr @"sa.static_pyarray.%tmp821.150c532c.0", ptr @"sa.static_pyarray.%tmp822.150c532c.0", ptr @"sa.static_pyarray.%tmp823.150c532c.0", ptr @"sa.static_pyarray.%tmp824.150c532c.0", ptr @"sa.static_pyarray.%tmp825.150c532c.0", ptr @"sa.static_pyarray.%tmp826.150c532c.0", ptr @"sa.static_pyarray.%tmp827.150c532c.0", ptr @"sa.static_pyarray.%tmp828.150c532c.0", ptr @"sa.static_pyarray.%tmp829.150c532c.0", ptr @"sa.static_pyarray.%tmp830.150c532c.0", ptr @"sa.static_pyarray.%tmp831.150c532c.0", ptr @"sa.static_pyarray.%tmp832.150c532c.0", ptr @"sa.static_pyarray.%tmp833.150c532c.0", ptr @"sa.static_pyarray.%tmp834.150c532c.0", ptr @"sa.static_pyarray.%tmp835.150c532c.0", ptr @"sa.static_pyarray.%tmp836.150c532c.0", ptr @"sa.static_pyarray.%tmp837.150c532c.0", ptr @"sa.static_pyarray.%tmp838.150c532c.0", ptr @"sa.static_pyarray.%tmp839.150c532c.0", ptr @"sa.static_pyarray.%tmp840.150c532c.0", ptr @"sa.static_pyarray.%tmp841.150c532c.0", ptr @"sa.static_pyarray.%tmp842.150c532c.0", ptr @"sa.static_pyarray.%tmp843.150c532c.0", ptr @"sa.static_pyarray.%tmp844.150c532c.0", ptr @"sa.static_pyarray.%tmp845.150c532c.0", ptr @"sa.static_pyarray.%tmp846.150c532c.0", ptr @"sa.static_pyarray.%tmp847.150c532c.0", ptr @"sa.static_pyarray.%tmp848.150c532c.0", ptr @"sa.static_pyarray.%tmp849.150c532c.0", ptr @"sa.static_pyarray.%tmp850.150c532c.0", ptr @"sa.static_pyarray.%tmp851.150c532c.0", ptr @"sa.static_pyarray.%tmp852.150c532c.0", ptr @"sa.static_pyarray.%tmp853.150c532c.0", ptr @"sa.static_pyarray.%tmp854.150c532c.0", ptr @"sa.static_pyarray.%tmp855.150c532c.0", ptr @"sa.static_pyarray.%tmp856.150c532c.0", ptr @"sa.static_pyarray.%tmp857.150c532c.0", ptr @"sa.static_pyarray.%tmp858.150c532c.0", ptr @"sa.static_pyarray.%tmp859.150c532c.0", ptr @"sa.static_pyarray.%tmp860.150c532c.0", ptr @"sa.static_pyarray.%tmp861.150c532c.0", ptr @"sa.static_pyarray.%tmp862.150c532c.0", ptr @"sa.static_pyarray.%tmp863.150c532c.0", ptr @"sa.static_pyarray.%tmp864.150c532c.0", ptr @"sa.static_pyarray.%tmp865.150c532c.0", ptr @"sa.static_pyarray.%tmp866.150c532c.0", ptr @"sa.static_pyarray.%tmp867.150c532c.0", ptr @"sa.static_pyarray.%tmp868.150c532c.0", ptr @"sa.static_pyarray.%tmp869.150c532c.0", ptr @"sa.static_pyarray.%tmp870.150c532c.0", ptr @"sa.static_pyarray.%tmp871.150c532c.0", ptr @"sa.static_pyarray.%tmp872.150c532c.0", ptr @"sa.static_pyarray.%tmp873.150c532c.0", ptr @"sa.static_pyarray.%tmp874.150c532c.0", ptr @"sa.static_pyarray.%tmp875.150c532c.0", ptr @"sa.static_pyarray.%tmp876.150c532c.0", ptr @"sa.static_pyarray.%tmp877.150c532c.0", ptr @"sa.static_pyarray.%tmp878.150c532c.0", ptr @"sa.static_pyarray.%tmp879.150c532c.0", ptr @"sa.static_pyarray.%tmp880.150c532c.0", ptr @"sa.static_pyarray.%tmp881.150c532c.0", ptr @"sa.static_pyarray.%tmp882.150c532c.0", ptr @"sa.static_pyarray.%tmp883.150c532c.0", ptr @"sa.static_pyarray.%tmp884.150c532c.0", ptr @"sa.static_pyarray.%tmp885.150c532c.0", ptr @"sa.static_pyarray.%tmp886.150c532c.0", ptr @"sa.static_pyarray.%tmp887.150c532c.0", ptr @"sa.static_pyarray.%tmp888.150c532c.0", ptr @"sa.static_pyarray.%tmp889.150c532c.0", ptr @"sa.static_pyarray.%tmp890.150c532c.0", ptr @"sa.static_pyarray.%tmp891.150c532c.0", ptr @"sa.static_pyarray.%tmp892.150c532c.0", ptr @"sa.static_pyarray.%tmp893.150c532c.0", ptr @"sa.static_pyarray.%tmp894.150c532c.0", ptr @"sa.static_pyarray.%tmp895.150c532c.0", ptr @"sa.static_pyarray.%tmp896.150c532c.0", ptr @"sa.static_pyarray.%tmp897.150c532c.0", ptr @"sa.static_pyarray.%tmp898.150c532c.0", ptr @"sa.static_pyarray.%tmp899.150c532c.0", ptr @"sa.static_pyarray.%tmp900.150c532c.0", ptr @"sa.static_pyarray.%tmp901.150c532c.0", ptr @"sa.static_pyarray.%tmp902.150c532c.0", ptr @"sa.static_pyarray.%tmp903.150c532c.0", ptr @"sa.static_pyarray.%tmp904.150c532c.0", ptr @"sa.static_pyarray.%tmp905.150c532c.0", ptr @"sa.static_pyarray.%tmp906.150c532c.0", ptr @"sa.static_pyarray.%tmp907.150c532c.0", ptr @"sa.static_pyarray.%tmp908.150c532c.0", ptr @"sa.static_pyarray.%tmp909.150c532c.0", ptr @"sa.static_pyarray.%tmp910.150c532c.0", ptr @"sa.static_pyarray.%tmp911.150c532c.0", ptr @"sa.static_pyarray.%tmp912.150c532c.0", ptr @"sa.static_pyarray.%tmp913.150c532c.0", ptr @"sa.static_pyarray.%tmp914.150c532c.0", ptr @"sa.static_pyarray.%tmp915.150c532c.0", ptr @"sa.static_pyarray.%tmp916.150c532c.0", ptr @"sa.static_pyarray.%tmp917.150c532c.0", ptr @"sa.static_pyarray.%tmp918.150c532c.0", ptr @"sa.static_pyarray.%tmp919.150c532c.0", ptr @"sa.static_pyarray.%tmp920.150c532c.0", ptr @"sa.static_pyarray.%tmp921.150c532c.0", ptr @"sa.static_pyarray.%tmp922.150c532c.0", ptr @"sa.static_pyarray.%tmp923.150c532c.0", ptr @"sa.static_pyarray.%tmp924.150c532c.0", ptr @"sa.static_pyarray.%tmp925.150c532c.0", ptr @"sa.static_pyarray.%tmp926.150c532c.0", ptr @"sa.static_pyarray.%tmp927.150c532c.0", ptr @"sa.static_pyarray.%tmp928.150c532c.0", ptr @"sa.static_pyarray.%tmp929.150c532c.0", ptr @"sa.static_pyarray.%tmp930.150c532c.0", ptr @"sa.static_pyarray.%tmp931.150c532c.0", ptr @"sa.static_pyarray.%tmp932.150c532c.0", ptr @"sa.static_pyarray.%tmp933.150c532c.0", ptr @"sa.static_pyarray.%tmp934.150c532c.0", ptr @"sa.static_pyarray.%tmp935.150c532c.0", ptr @"sa.static_pyarray.%tmp936.150c532c.0", ptr @"sa.static_pyarray.%tmp937.150c532c.0", ptr @"sa.static_pyarray.%tmp938.150c532c.0", ptr @"sa.static_pyarray.%tmp939.150c532c.0", ptr @"sa.static_pyarray.%tmp940.150c532c.0", ptr @"sa.static_pyarray.%tmp941.150c532c.0", ptr @"sa.static_pyarray.%tmp942.150c532c.0", ptr @"sa.static_pyarray.%tmp943.150c532c.0", ptr @"sa.static_pyarray.%tmp944.150c532c.0", ptr @"sa.static_pyarray.%tmp945.150c532c.0", ptr @"sa.static_pyarray.%tmp946.150c532c.0", ptr @"sa.static_pyarray.%tmp947.150c532c.0", ptr @"sa.static_pyarray.%tmp948.150c532c.0", ptr @"sa.static_pyarray.%tmp949.150c532c.0", ptr @"sa.static_pyarray.%tmp950.150c532c.0", ptr @"sa.static_pyarray.%tmp951.150c532c.0", ptr @"sa.static_pyarray.%tmp952.150c532c.0", ptr @"sa.static_pyarray.%tmp953.150c532c.0", ptr @"sa.static_pyarray.%tmp954.150c532c.0", ptr @"sa.static_pyarray.%tmp955.150c532c.0", ptr @"sa.static_pyarray.%tmp956.150c532c.0", ptr @"sa.static_pyarray.%tmp957.150c532c.0", ptr @"sa.static_pyarray.%tmp958.150c532c.0", ptr @"sa.static_pyarray.%tmp959.150c532c.0", ptr @"sa.static_pyarray.%tmp960.150c532c.0", ptr @"sa.static_pyarray.%tmp961.150c532c.0", ptr @"sa.static_pyarray.%tmp962.150c532c.0", ptr @"sa.static_pyarray.%tmp963.150c532c.0", ptr @"sa.static_pyarray.%tmp964.150c532c.0", ptr @"sa.static_pyarray.%tmp965.150c532c.0", ptr @"sa.static_pyarray.%tmp966.150c532c.0", ptr @"sa.static_pyarray.%tmp967.150c532c.0", ptr @"sa.static_pyarray.%tmp968.150c532c.0", ptr @"sa.static_pyarray.%tmp969.150c532c.0", ptr @"sa.static_pyarray.%tmp970.150c532c.0", ptr @"sa.static_pyarray.%tmp971.150c532c.0", ptr @"sa.static_pyarray.%tmp972.150c532c.0", ptr @"sa.static_pyarray.%tmp973.150c532c.0", ptr @"sa.static_pyarray.%tmp974.150c532c.0", ptr @"sa.static_pyarray.%tmp975.150c532c.0", ptr @"sa.static_pyarray.%tmp976.150c532c.0", ptr @"sa.static_pyarray.%tmp977.150c532c.0", ptr @"sa.static_pyarray.%tmp978.150c532c.0", ptr @"sa.static_pyarray.%tmp979.150c532c.0", ptr @"sa.static_pyarray.%tmp980.150c532c.0", ptr @"sa.static_pyarray.%tmp981.150c532c.0", ptr @"sa.static_pyarray.%tmp982.150c532c.0", ptr @"sa.static_pyarray.%tmp983.150c532c.0", ptr @"sa.static_pyarray.%tmp984.150c532c.0", ptr @"sa.static_pyarray.%tmp985.150c532c.0", ptr @"sa.static_pyarray.%tmp986.150c532c.0", ptr @"sa.static_pyarray.%tmp987.150c532c.0", ptr @"sa.static_pyarray.%tmp988.150c532c.0", ptr @"sa.static_pyarray.%tmp989.150c532c.0", ptr @"sa.static_pyarray.%tmp990.150c532c.0", ptr @"sa.static_pyarray.%tmp991.150c532c.0", ptr @"sa.static_pyarray.%tmp992.150c532c.0", ptr @"sa.static_pyarray.%tmp993.150c532c.0", ptr @"sa.static_pyarray.%tmp994.150c532c.0", ptr @"sa.static_pyarray.%tmp995.150c532c.0", ptr @"sa.static_pyarray.%tmp996.150c532c.0", ptr @"sa.static_pyarray.%tmp997.150c532c.0", ptr @"sa.static_pyarray.%tmp998.150c532c.0", ptr @"sa.static_pyarray.%tmp999.150c532c.0", ptr @"sa.static_pyarray.%tmp1000.150c532c.0", ptr @"sa.static_pyarray.%tmp1001.150c532c.0", ptr @"sa.static_pyarray.%tmp1002.150c532c.0", ptr @"sa.static_pyarray.%tmp1003.150c532c.0"] } +@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @e_tket.rotat.20D0216B.0 = private constant [55 x i8] c"6EXIT:INT:tket.rotation.from_halfturns_unchecked failed" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_entangled_.CC58B637.0 = private constant [27 x i8] c"\1AUSER:STATE:entangled_state" -@e_Frozenarra.36077F52.0 = private constant [41 x i8] c"(EXIT:INT:Frozenarray index out of bounds" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %shot = tail call i64 @get_current_shot() + %0 = icmp ult i64 %shot, 1000 + br i1 %0, label %static_array_get_in_bounds, label %static_array_get_exit + +static_array_get_in_bounds: ; preds = %alloca_block + %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot + %2 = load ptr, ptr %1, align 8 + br label %static_array_get_exit + +static_array_get_exit: ; preds = %alloca_block, %static_array_get_in_bounds + %"0.sroa.3.0" = phi ptr [ %2, %static_array_get_in_bounds ], [ poison, %alloca_block ] %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_62_case_0.i, label %__hugr__.__tk2_sol_qalloc.67.exit + br i1 %not_max.not.not.i, label %cond_76_case_0.i, label %__hugr__.__tk2_sol_qalloc.72.exit -cond_62_case_0.i: ; preds = %alloca_block +cond_76_case_0.i: ; preds = %static_array_get_exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.67.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.72.exit: ; preds = %static_array_get_exit tail call void @___reset(i64 %qalloc.i) - %0 = icmp ult i64 %shot, 1000 - br i1 %0, label %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit", label %cond_88_case_0.i + br i1 %0, label %cond_10_case_1, label %cond_10_case_0 + +cond_10_case_1: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit + %3 = load i64, ptr %"0.sroa.3.0", align 4 + %4 = icmp ugt i64 %3, 2 + br i1 %4, label %static_array_get_exit16.thread, label %static_array_get_exit16 -cond_88_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.67.exit +cond_10_case_0: ; preds = %__hugr__.__tk2_sol_qalloc.72.exit tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit": ; preds = %__hugr__.__tk2_sol_qalloc.67.exit - %1 = getelementptr inbounds nuw { i64, [0 x ptr] }, ptr @"sa.static_pyarray.%tmp1004.150c532c.0", i64 0, i32 1, i64 %shot - %2 = load ptr, ptr %1, align 8 - %3 = load i64, ptr %2, align 4 - %.not = icmp eq i64 %3, 0 - br i1 %.not, label %cond_103_case_0.i, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +static_array_get_exit16.thread: ; preds = %cond_10_case_1 + %5 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 24 + %6 = load double, ptr %5, align 8 + br label %static_array_get_exit23.thread -cond_103_case_0.i: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) - unreachable +static_array_get_exit23.thread: ; preds = %static_array_get_exit16, %static_array_get_exit16.thread + %"015.sroa.3.0114" = phi double [ %6, %static_array_get_exit16.thread ], [ poison, %static_array_get_exit16 ] + %7 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 16 + %8 = load double, ptr %7, align 8 + br label %cond_21_case_1 + +cond_21_case_1: ; preds = %static_array_get_exit16, %static_array_get_exit23.thread + %9 = phi i1 [ true, %static_array_get_exit23.thread ], [ false, %static_array_get_exit16 ] + %"015.sroa.3.0113" = phi double [ %"015.sroa.3.0114", %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %"022.sroa.3.0111" = phi double [ %8, %static_array_get_exit23.thread ], [ poison, %static_array_get_exit16 ] + %10 = getelementptr inbounds nuw i8, ptr %"0.sroa.3.0", i64 8 + %11 = load double, ptr %10, align 8 + %12 = tail call double @llvm.fabs.f64(double %11) + %13 = fcmp ueq double %12, 0x7FF0000000000000 + br i1 %13, label %14, label %15 -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(static_array(float64)).83.exit" - %4 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %5 = load double, ptr %4, align 8 - %.not52 = icmp eq i64 %3, 1 - br i1 %.not52, label %cond_103_case_0.i48, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +static_array_get_exit16: ; preds = %cond_10_case_1 + switch i64 %3, label %cond_21_case_1 [ + i64 2, label %static_array_get_exit23.thread + i64 0, label %cond_21_case_0 + ] -cond_103_case_0.i48: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" +cond_21_case_0: ; preds = %static_array_get_exit16 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit" - %6 = getelementptr inbounds nuw i8, ptr %2, i64 16 - %7 = load double, ptr %6, align 8 - %8 = icmp ugt i64 %3, 2 - br i1 %8, label %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51", label %cond_103_case_0.i50 +14: ; preds = %cond_21_case_1 + tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) + unreachable + +15: ; preds = %cond_21_case_1 + %16 = fmul double %11, 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %16, double 0.000000e+00) + br i1 %9, label %cond_32_case_1, label %cond_32_case_0 + +cond_32_case_1: ; preds = %15 + %17 = tail call double @llvm.fabs.f64(double %"022.sroa.3.0111") + %18 = fcmp ueq double %17, 0x7FF0000000000000 + br i1 %18, label %19, label %20 -cond_103_case_0.i50: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" +cond_32_case_0: ; preds = %15 tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) unreachable -"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51": ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit49" - %9 = getelementptr inbounds nuw i8, ptr %2, i64 24 - %10 = load double, ptr %9, align 8 - %11 = tail call double @llvm.fabs.f64(double %10) - %12 = fcmp ueq double %11, 0x7FF0000000000000 - br i1 %12, label %13, label %14 - -13: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" +19: ; preds = %cond_32_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -14: ; preds = %"__hugr__.$frozenarray.__getitem__.1$$e(float64).98.exit51" - %15 = tail call double @llvm.fabs.f64(double %7) - %16 = fcmp ueq double %15, 0x7FF0000000000000 - br i1 %16, label %17, label %18 +20: ; preds = %cond_32_case_1 + %21 = fmul double %"022.sroa.3.0111", 0x400921FB54442D18 + tail call void @___rp(i64 %qalloc.i, double %21, double 0x3FF921FB54442D18) + br i1 %4, label %cond_43_case_1, label %cond_43_case_0 -17: ; preds = %14 - tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) - unreachable +cond_43_case_1: ; preds = %20 + %22 = tail call double @llvm.fabs.f64(double %"015.sroa.3.0113") + %23 = fcmp ueq double %22, 0x7FF0000000000000 + br i1 %23, label %24, label %25 -18: ; preds = %14 - %19 = tail call double @llvm.fabs.f64(double %5) - %20 = fcmp ueq double %19, 0x7FF0000000000000 - br i1 %20, label %21, label %22 +cond_43_case_0: ; preds = %20 + tail call void @panic(i32 1001, ptr nonnull @e_Frozenarra.36077F52.0) + unreachable -21: ; preds = %18 +24: ; preds = %cond_43_case_1 tail call void @panic(i32 1001, ptr nonnull @e_tket.rotat.20D0216B.0) unreachable -22: ; preds = %18 - %23 = fmul double %5, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %23, double 0.000000e+00) - %24 = fmul double %7, 0x400921FB54442D18 - tail call void @___rp(i64 %qalloc.i, double %24, double 0x3FF921FB54442D18) - %25 = fmul double %10, 0x400921FB54442D18 - tail call void @___rz(i64 %qalloc.i, double %25) - %26 = tail call ptr @heap_alloc(i64 8) +25: ; preds = %cond_43_case_1 + %26 = fmul double %"015.sroa.3.0113", 0x400921FB54442D18 + tail call void @___rz(i64 %qalloc.i, double %26) %27 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %27, align 1 - store i64 %qalloc.i, ptr %26, align 4 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %28, 1 - store i64 %29, ptr %27, align 4 - %30 = icmp eq i64 %29, 0 - br i1 %30, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i + %28 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %28, align 1 + store i64 %qalloc.i, ptr %27, align 4 + %29 = load i64, ptr %28, align 4 + %30 = and i64 %29, 1 + store i64 %30, ptr %28, align 4 + %31 = icmp eq i64 %30, 0 + br i1 %31, label %__barray_mask_check_not_borrowed.exit, label %mask_block_err.i -mask_block_err.i: ; preds = %22 +mask_block_err.i: ; preds = %25 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_mask_check_not_borrowed.exit: ; preds = %22 +__barray_mask_check_not_borrowed.exit: ; preds = %25 %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %31 = alloca i1, align 1 - store i1 false, ptr %31, align 1 + %32 = alloca i1, align 1 + store i1 false, ptr %32, align 1 store i32 1, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %26, ptr %arr_ptr, align 8 - store ptr %31, ptr %mask_ptr, align 8 + store ptr %27, ptr %arr_ptr, align 8 + store ptr %32, ptr %mask_ptr, align 8 call void @print_state_result(ptr nonnull @res_entangled_.CC58B637.0, i64 26, ptr nonnull %out_arr_alloca) - %32 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %32, align 1 - %33 = load i64, ptr %26, align 4 - call void @___qfree(i64 %33) + %33 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %33, align 1 + %34 = load i64, ptr %27, align 4 + call void @___qfree(i64 %34) ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples.sha256 b/selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples.sha256 similarity index 100% rename from selene-sim/python/tests/resources/from_guppy/test_debug/test_stim_gate_implementations_single_qubit_triples[helios]/stim_gate_implementation_triples.sha256 rename to selene-sim/python/tests/resources/from_guppy/test_quantum_state/test_stim_gate_implementations_single_qubit_triples[sol]/stim_gate_implementation_triples.sha256 diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll index 86d839c3..1bd20fe5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll index b5a41d74..8f7cd078 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll index 9a64c49b..6cf67f12 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll index a67a6e45..4bb9dbc8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll index 7d50f726..11331961 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll index 29600e4d..065412b6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll index e834f1b0..8b2d9af0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll index 0df62709..9b35f9de 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll index 2fbcbd49..d9f4c835 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll index bc7d6048..26706639 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[QuestPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll index 86d839c3..1bd20fe5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll index b5a41d74..8f7cd078 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-aarch64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll index 9a64c49b..6cf67f12 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll index a67a6e45..4bb9dbc8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll index 7d50f726..11331961 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-helios-x86_64-windows-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_helios_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_helios_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_helios_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.54.exit: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) - tail call void @___rxy(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18) +__hugr__.__tk2_helios_qalloc.25.exit40: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) + tail call void @___rxy(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_helios_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_helios_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.68.exit: ; preds = %__hugr__.__tk2_helios_qalloc.54.exit +__hugr__.__tk2_helios_qalloc.25.exit44: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) tail call void @___rxy(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x400921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) tail call void @___rxy(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_helios_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_helios_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_helios_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_helios_qalloc.25.exit50: ; preds = %__hugr__.__tk2_helios_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %qalloc.i45, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %qalloc.i47, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_helios_qalloc.82.exit: ; preds = %__hugr__.__tk2_heli %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll index 29600e4d..065412b6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll index e834f1b0..8b2d9af0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-aarch64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll index 0df62709..9b35f9de 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-apple-darwin.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll index 2fbcbd49..d9f4c835 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-unknown-linux-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll index bc7d6048..26706639 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_quantum_replay[StimPlugin]/quantum_replay_quest-sol-x86_64-windows-gnu.ll @@ -13,69 +13,69 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_29_case_0.i, label %__hugr__.__tk2_sol_qalloc.25.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_29_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.25.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) - %qalloc.i39 = tail call i64 @___qalloc() - %not_max.not.not.i40 = icmp eq i64 %qalloc.i39, -1 - br i1 %not_max.not.not.i40, label %cond_58_case_0.i, label %__hugr__.__tk2_sol_qalloc.54.exit + %qalloc.i37 = tail call i64 @___qalloc() + %not_max.not.not.i38 = icmp eq i64 %qalloc.i37, -1 + br i1 %not_max.not.not.i38, label %cond_29_case_0.i39, label %__hugr__.__tk2_sol_qalloc.25.exit40 -cond_58_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_29_case_0.i39: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.54.exit: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit - tail call void @___reset(i64 %qalloc.i39) +__hugr__.__tk2_sol_qalloc.25.exit40: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit + tail call void @___reset(i64 %qalloc.i37) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i, i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0xBFF921FB54442D18) %qalloc.i41 = tail call i64 @___qalloc() %not_max.not.not.i42 = icmp eq i64 %qalloc.i41, -1 - br i1 %not_max.not.not.i42, label %cond_72_case_0.i, label %__hugr__.__tk2_sol_qalloc.68.exit + br i1 %not_max.not.not.i42, label %cond_29_case_0.i43, label %__hugr__.__tk2_sol_qalloc.25.exit44 -cond_72_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +cond_29_case_0.i43: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.68.exit: ; preds = %__hugr__.__tk2_sol_qalloc.54.exit +__hugr__.__tk2_sol_qalloc.25.exit44: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit40 tail call void @___reset(i64 %qalloc.i41) - tail call void @___rp(i64 %qalloc.i39, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i39, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i37, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %qalloc.i37, i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i39, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %qalloc.i39, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %qalloc.i37, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %qalloc.i37, double 0xBFF921FB54442D18) tail call void @___rp(i64 %qalloc.i41, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i45 = tail call i64 @___qalloc() - %not_max.not.not.i46 = icmp eq i64 %qalloc.i45, -1 - br i1 %not_max.not.not.i46, label %cond_86_case_0.i, label %__hugr__.__tk2_sol_qalloc.82.exit + %qalloc.i47 = tail call i64 @___qalloc() + %not_max.not.not.i48 = icmp eq i64 %qalloc.i47, -1 + br i1 %not_max.not.not.i48, label %cond_29_case_0.i49, label %__hugr__.__tk2_sol_qalloc.25.exit50 -cond_86_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit +cond_29_case_0.i49: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_qalloc.68.exit - tail call void @___reset(i64 %qalloc.i45) +__hugr__.__tk2_sol_qalloc.25.exit50: ; preds = %__hugr__.__tk2_sol_qalloc.25.exit44 + tail call void @___reset(i64 %qalloc.i47) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i41, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i45, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %qalloc.i45, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rpp(i64 %qalloc.i41, i64 %qalloc.i47, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i47, double 0xBFF921FB54442D18, double 0.000000e+00) tail call void @___rp(i64 %qalloc.i41, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) tail call void @___rz(i64 %qalloc.i41, double 0xBFF921FB54442D18) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i39) - tail call void @___qfree(i64 %qalloc.i39) + %lazy_measure14 = tail call i64 @___lazy_measure(i64 %qalloc.i37) + tail call void @___qfree(i64 %qalloc.i37) %read_bool16 = tail call i1 @___read_future_bool(i64 %lazy_measure14) tail call void @___dec_future_refcount(i64 %lazy_measure14) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool16) @@ -84,8 +84,8 @@ __hugr__.__tk2_sol_qalloc.82.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool24 = tail call i1 @___read_future_bool(i64 %lazy_measure22) tail call void @___dec_future_refcount(i64 %lazy_measure22) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool24) - %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i45) - tail call void @___qfree(i64 %qalloc.i45) + %lazy_measure30 = tail call i64 @___lazy_measure(i64 %qalloc.i47) + tail call void @___qfree(i64 %qalloc.i47) %read_bool32 = tail call i1 @___read_future_bool(i64 %lazy_measure30) tail call void @___dec_future_refcount(i64 %lazy_measure30) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool32) diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-apple-darwin.ll index b9f2bfc8..885d99ad 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-apple-darwin.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_helios_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rxy(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-unknown-linux-gnu.ll index 93bceeb9..18540c13 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-aarch64-unknown-linux-gnu.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_helios_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rxy(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-apple-darwin.ll index d37387e5..002e9cb5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-apple-darwin.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_helios_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rxy(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-unknown-linux-gnu.ll index 4bbde852..847c855e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-unknown-linux-gnu.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_helios_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rxy(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-windows-gnu.ll index 7d44678c..4e742deb 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-helios-x86_64-windows-gnu.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_helios_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rxy(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_helios_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-apple-darwin.ll index b102c5f0..9d189a77 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-apple-darwin.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_sol_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rp(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-unknown-linux-gnu.ll index 754deb2b..59232e93 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-aarch64-unknown-linux-gnu.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_sol_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rp(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-apple-darwin.ll index 5dcb8481..ce965837 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-apple-darwin.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_sol_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rp(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-unknown-linux-gnu.ll index 158a487a..abd9db51 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-unknown-linux-gnu.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_sol_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rp(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-windows-gnu.ll index 57acef6c..51ca3471 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_replay/test_recursive_condition/recursive_condition-sol-x86_64-windows-gnu.ll @@ -10,16 +10,16 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: br label %tailrecurse.i -tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i, %alloca_block +tailrecurse.i: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i, %alloca_block %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1 - br i1 %not_max.not.not.i.i, label %cond_48_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.44.exit.i + br i1 %not_max.not.not.i.i, label %cond_36_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.32.exit.i -cond_48_case_0.i.i: ; preds = %tailrecurse.i +cond_36_case_0.i.i: ; preds = %tailrecurse.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i +__hugr__.__tk2_sol_qalloc.32.exit.i: ; preds = %tailrecurse.i tail call void @___reset(i64 %qalloc.i.i) tail call void @___rp(i64 %qalloc.i.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i.i, double 0x400921FB54442D18) @@ -28,9 +28,9 @@ __hugr__.__tk2_sol_qalloc.44.exit.i: ; preds = %tailrecurse.i %read_bool.i = tail call i1 @___read_future_bool(i64 %lazy_measure.i) tail call void @___dec_future_refcount(i64 %lazy_measure.i) tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %read_bool.i) - br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.12.exit + br i1 %read_bool.i, label %tailrecurse.i, label %__hugr__.__main__.recursive_condition.5.exit -__hugr__.__main__.recursive_condition.12.exit: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit.i +__hugr__.__main__.recursive_condition.5.exit: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit.i ret void } diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-apple-darwin.ll index 74e31fe0..952a95ee 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-apple-darwin.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit + br i1 %not_max.not.not.i, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit -cond_526_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_403_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.453.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.329.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.453.exit.1, %__hugr__.__tk2_helios_qalloc.453.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.329.exit.1, %__hugr__.__tk2_helios_qalloc.329.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit.1 + br i1 %not_max.not.not.i.1, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit.1 -__hugr__.__tk2_helios_qalloc.453.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.329.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_526_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_403_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rxy(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rxy(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %30, i64 %33, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rxy(i64 %29, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %22, i64 %29, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %29, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %29, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %60, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %57, i64 %60, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %60, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %60, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %73, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %70, i64 %73, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %73, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %73, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_549, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_426, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_549.2 +mask_block_err.i762: ; preds = %cond_exit_426.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_549 - -cond_exit_549: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_549.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_549 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_549.1 - -cond_exit_549.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_549 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_549.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_549.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_549.2 - -cond_exit_549.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_549.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_549.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_426 + +cond_exit_426: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_426.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_426 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_426.1 + +cond_exit_426.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_426 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_426.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_426.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_426.2 + +cond_exit_426.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_426.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_426.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rzz(i64, i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-unknown-linux-gnu.ll index e313e004..705f268b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-aarch64-unknown-linux-gnu.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit + br i1 %not_max.not.not.i, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit -cond_526_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_403_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.453.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.329.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.453.exit.1, %__hugr__.__tk2_helios_qalloc.453.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.329.exit.1, %__hugr__.__tk2_helios_qalloc.329.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit.1 + br i1 %not_max.not.not.i.1, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit.1 -__hugr__.__tk2_helios_qalloc.453.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.329.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_526_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_403_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rxy(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rxy(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %30, i64 %33, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rxy(i64 %29, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %22, i64 %29, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %29, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %29, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %60, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %57, i64 %60, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %60, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %60, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %73, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %70, i64 %73, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %73, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %73, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_549, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_426, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_549.2 +mask_block_err.i762: ; preds = %cond_exit_426.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_549 - -cond_exit_549: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_549.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_549 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_549.1 - -cond_exit_549.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_549 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_549.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_549.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_549.2 - -cond_exit_549.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_549.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_549.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_426 + +cond_exit_426: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_426.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_426 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_426.1 + +cond_exit_426.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_426 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_426.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_426.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_426.2 + +cond_exit_426.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_426.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_426.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rzz(i64, i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-apple-darwin.ll index bfc49ca8..97320465 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-apple-darwin.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit + br i1 %not_max.not.not.i, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit -cond_526_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_403_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.453.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.329.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.453.exit.1, %__hugr__.__tk2_helios_qalloc.453.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.329.exit.1, %__hugr__.__tk2_helios_qalloc.329.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit.1 + br i1 %not_max.not.not.i.1, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit.1 -__hugr__.__tk2_helios_qalloc.453.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.329.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_526_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_403_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rxy(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rxy(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %30, i64 %33, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rxy(i64 %29, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %22, i64 %29, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %29, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %29, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %60, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %57, i64 %60, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %60, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %60, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %73, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %70, i64 %73, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %73, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %73, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_549, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_426, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_549.2 +mask_block_err.i762: ; preds = %cond_exit_426.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_549 - -cond_exit_549: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_549.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_549 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_549.1 - -cond_exit_549.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_549 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_549.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_549.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_549.2 - -cond_exit_549.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_549.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_549.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_426 + +cond_exit_426: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_426.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_426 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_426.1 + +cond_exit_426.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_426 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_426.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_426.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_426.2 + +cond_exit_426.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_426.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_426.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rzz(i64, i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-unknown-linux-gnu.ll index f560b923..542c8a00 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-unknown-linux-gnu.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit + br i1 %not_max.not.not.i, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit -cond_526_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_403_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.453.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.329.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.453.exit.1, %__hugr__.__tk2_helios_qalloc.453.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.329.exit.1, %__hugr__.__tk2_helios_qalloc.329.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit.1 + br i1 %not_max.not.not.i.1, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit.1 -__hugr__.__tk2_helios_qalloc.453.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.329.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_526_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_403_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rxy(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rxy(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %30, i64 %33, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rxy(i64 %29, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %22, i64 %29, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %29, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %29, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %60, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %57, i64 %60, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %60, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %60, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %73, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %70, i64 %73, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %73, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %73, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_549, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_426, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_549.2 +mask_block_err.i762: ; preds = %cond_exit_426.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_549 - -cond_exit_549: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_549.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_549 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_549.1 - -cond_exit_549.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_549 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_549.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_549.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_549.2 - -cond_exit_549.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_549.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_549.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_426 + +cond_exit_426: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_426.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_426 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_426.1 + +cond_exit_426.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_426 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_426.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_426.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_426.2 + +cond_exit_426.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_426.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_426.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rzz(i64, i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-windows-gnu.ll index a6367847..c7521058 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-helios-x86_64-windows-gnu.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit + br i1 %not_max.not.not.i, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit -cond_526_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_403_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.453.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.329.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.453.exit.1, %__hugr__.__tk2_helios_qalloc.453.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_helios_qalloc.329.exit.1, %__hugr__.__tk2_helios_qalloc.329.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_526_case_0.i, label %__hugr__.__tk2_helios_qalloc.453.exit.1 + br i1 %not_max.not.not.i.1, label %cond_403_case_0.i, label %__hugr__.__tk2_helios_qalloc.329.exit.1 -__hugr__.__tk2_helios_qalloc.453.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.329.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.453.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.329.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_526_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_403_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rxy(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rxy(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rxy(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %18, i64 %22, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %22, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %33, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %30, i64 %33, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %33, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %33, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rxy(i64 %29, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %22, i64 %29, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %29, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %29, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rxy(i64 %60, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %57, i64 %60, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %60, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %60, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rxy(i64 %73, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %70, i64 %73, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %73, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %73, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_549, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_426, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_549.2 +mask_block_err.i762: ; preds = %cond_exit_426.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_549 - -cond_exit_549: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_549.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_549 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_549.1 - -cond_exit_549.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_549 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_549.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_549.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_549.2 - -cond_exit_549.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_549.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_549.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_426 + +cond_exit_426: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_426.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_426 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_426.1 + +cond_exit_426.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_426 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_426.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_426.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_426.2 + +cond_exit_426.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_426.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_426.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rxy(i64, double, double) local_unnamed_addr declare void @___rzz(i64, i64, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-apple-darwin.ll index 22e1b7cc..2c122470 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-apple-darwin.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit + br i1 %not_max.not.not.i, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit -cond_523_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_402_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.450.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.328.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.450.exit.1, %__hugr__.__tk2_sol_qalloc.450.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.328.exit.1, %__hugr__.__tk2_sol_qalloc.328.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit.1 + br i1 %not_max.not.not.i.1, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit.1 -__hugr__.__tk2_sol_qalloc.450.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.328.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_523_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_402_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rp(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %30, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %30, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %30, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %22, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %29, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %57, i64 %60, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %60, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %57, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %70, i64 %73, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %73, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_546, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_425, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_546.2 +mask_block_err.i762: ; preds = %cond_exit_425.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_546 - -cond_exit_546: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_546.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_546 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_546.1 - -cond_exit_546.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_546 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_546.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_546.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_546.2 - -cond_exit_546.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_546.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_546.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_425 + +cond_exit_425: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_425.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_425 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_425.1 + +cond_exit_425.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_425 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_425.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_425.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_425.2 + +cond_exit_425.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_425.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_425.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rpp(i64, i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-unknown-linux-gnu.ll index a653b266..b00fa7e2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-aarch64-unknown-linux-gnu.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit + br i1 %not_max.not.not.i, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit -cond_523_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_402_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.450.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.328.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.450.exit.1, %__hugr__.__tk2_sol_qalloc.450.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.328.exit.1, %__hugr__.__tk2_sol_qalloc.328.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit.1 + br i1 %not_max.not.not.i.1, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit.1 -__hugr__.__tk2_sol_qalloc.450.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.328.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_523_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_402_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rp(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %30, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %30, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %30, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %22, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %29, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %57, i64 %60, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %60, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %57, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %70, i64 %73, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %73, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_546, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_425, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_546.2 +mask_block_err.i762: ; preds = %cond_exit_425.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_546 - -cond_exit_546: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_546.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_546 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_546.1 - -cond_exit_546.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_546 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_546.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_546.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_546.2 - -cond_exit_546.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_546.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_546.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_425 + +cond_exit_425: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_425.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_425 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_425.1 + +cond_exit_425.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_425 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_425.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_425.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_425.2 + +cond_exit_425.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_425.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_425.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rpp(i64, i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-apple-darwin.ll index d53d6fc1..886411db 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-apple-darwin.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit + br i1 %not_max.not.not.i, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit -cond_523_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_402_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.450.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.328.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.450.exit.1, %__hugr__.__tk2_sol_qalloc.450.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.328.exit.1, %__hugr__.__tk2_sol_qalloc.328.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit.1 + br i1 %not_max.not.not.i.1, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit.1 -__hugr__.__tk2_sol_qalloc.450.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.328.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_523_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_402_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rp(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %30, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %30, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %30, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %22, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %29, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %57, i64 %60, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %60, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %57, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %70, i64 %73, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %73, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_546, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_425, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_546.2 +mask_block_err.i762: ; preds = %cond_exit_425.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_546 - -cond_exit_546: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_546.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_546 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_546.1 - -cond_exit_546.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_546 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_546.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_546.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_546.2 - -cond_exit_546.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_546.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_546.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_425 + +cond_exit_425: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_425.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_425 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_425.1 + +cond_exit_425.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_425 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_425.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_425.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_425.2 + +cond_exit_425.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_425.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_425.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rpp(i64, i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-unknown-linux-gnu.ll index eddab946..a5ba3bc7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-unknown-linux-gnu.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit + br i1 %not_max.not.not.i, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit -cond_523_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_402_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.450.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.328.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.450.exit.1, %__hugr__.__tk2_sol_qalloc.450.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.328.exit.1, %__hugr__.__tk2_sol_qalloc.328.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit.1 + br i1 %not_max.not.not.i.1, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit.1 -__hugr__.__tk2_sol_qalloc.450.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.328.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_523_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_402_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rp(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %30, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %30, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %30, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %22, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %29, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %57, i64 %60, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %60, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %57, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %70, i64 %73, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %73, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_546, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_425, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_546.2 +mask_block_err.i762: ; preds = %cond_exit_425.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_546 - -cond_exit_546: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_546.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_546 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_546.1 - -cond_exit_546.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_546 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_546.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_546.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_546.2 - -cond_exit_546.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_546.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_546.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_425 + +cond_exit_425: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_425.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_425 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_425.1 + +cond_exit_425.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_425 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_425.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_425.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_425.2 + +cond_exit_425.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_425.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_425.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rpp(i64, i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-windows-gnu.ll index fde35280..3d5952d0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_runtimes/test_simple_vs_softrz/simple_vs_softrz-sol-x86_64-windows-gnu.ll @@ -16,555 +16,382 @@ alloca_block: %0 = tail call ptr @heap_alloc(i64 24) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 24) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit + br i1 %not_max.not.not.i, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit -cond_523_case_0.i: ; preds = %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_402_case_0.i: ; preds = %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.450.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.328.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %4 = load i64, ptr %3, align 4 + %5 = trunc i64 %4 to i1 + br i1 %5, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.450.exit.1, %__hugr__.__tk2_sol_qalloc.450.exit +panic.i: ; preds = %__barray_check_bounds.exit.2, %__hugr__.__tk2_sol_qalloc.328.exit.1, %__hugr__.__tk2_sol_qalloc.328.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit + %6 = and i64 %4, -2 + store i64 %6, ptr %3, align 4 + store i64 %qalloc.i, ptr %2, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_523_case_0.i, label %__hugr__.__tk2_sol_qalloc.450.exit.1 + br i1 %not_max.not.not.i.1, label %cond_402_case_0.i, label %__hugr__.__tk2_sol_qalloc.328.exit.1 -__hugr__.__tk2_sol_qalloc.450.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.328.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not564 = icmp eq i64 %6, 0 - br i1 %.not564, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.450.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %7 = load i64, ptr %3, align 4 + %8 = and i64 %7, 2 + %.not789 = icmp eq i64 %8, 0 + br i1 %.not789, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.328.exit.1 + %9 = and i64 %7, -3 + store i64 %9, ptr %3, align 4 + %10 = getelementptr inbounds nuw i8, ptr %2, i64 8 + store i64 %qalloc.i.1, ptr %10, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_523_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_402_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not565 = icmp eq i64 %10, 0 - br i1 %.not565, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %13 = load i64, ptr %1, align 4 - %14 = trunc i64 %13 to i1 - br i1 %14, label %panic.i482, label %__barray_mask_borrow.exit - -panic.i482: ; preds = %cond_exit_20.2 + %11 = load i64, ptr %3, align 4 + %12 = and i64 %11, 4 + %.not790 = icmp eq i64 %12, 0 + br i1 %.not790, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %13 = and i64 %11, -5 + store i64 %13, ptr %3, align 4 + %14 = getelementptr inbounds nuw i8, ptr %2, i64 16 + store i64 %qalloc.i.2, ptr %14, align 4 + %15 = load i64, ptr %3, align 4 + %16 = trunc i64 %15 to i1 + br i1 %16, label %panic.i724, label %__barray_mask_borrow.exit + +panic.i724: ; preds = %cond_exit_12.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.2 - %15 = or disjoint i64 %13, 1 - store i64 %15, ptr %1, align 4 - %16 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %16, double 0x400921FB54442D18, double 0.000000e+00) - %17 = load i64, ptr %1, align 4 - %18 = trunc i64 %17 to i1 - br i1 %18, label %__barray_mask_return.exit484, label %panic.i483 +__barray_mask_borrow.exit: ; preds = %cond_exit_12.2 + %17 = or disjoint i64 %15, 1 + store i64 %17, ptr %3, align 4 + %18 = load i64, ptr %2, align 4 + tail call void @___rp(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) + %19 = load i64, ptr %3, align 4 + %20 = and i64 %19, 2 + %.not = icmp eq i64 %20, 0 + br i1 %.not, label %__barray_mask_borrow.exit726, label %panic.i725 -panic.i483: ; preds = %__barray_mask_borrow.exit - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit484: ; preds = %__barray_mask_borrow.exit - %19 = and i64 %17, -2 - store i64 %19, ptr %1, align 4 - store i64 %16, ptr %0, align 4 - %20 = load i64, ptr %1, align 4 - %21 = and i64 %20, 2 - %.not = icmp eq i64 %21, 0 - br i1 %.not, label %__barray_mask_borrow.exit486, label %panic.i485 - -panic.i485: ; preds = %__barray_mask_return.exit484 +panic.i725: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit486: ; preds = %__barray_mask_return.exit484 - %22 = or disjoint i64 %20, 2 - store i64 %22, ptr %1, align 4 - %23 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %23, double 0x400921FB54442D18, double 0.000000e+00) - %24 = load i64, ptr %1, align 4 - %25 = and i64 %24, 2 - %.not545 = icmp eq i64 %25, 0 - br i1 %.not545, label %panic.i487, label %__barray_mask_return.exit488 - -panic.i487: ; preds = %__barray_mask_borrow.exit486 +__barray_mask_borrow.exit726: ; preds = %__barray_mask_borrow.exit + %21 = or disjoint i64 %19, 2 + store i64 %21, ptr %3, align 4 + %22 = load i64, ptr %10, align 4 + tail call void @___rp(i64 %22, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %22, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %18, double 0x400921FB54442D18) + tail call void @___rp(i64 %18, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %18, i64 %22, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %18, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %18, double 0xBFF921FB54442D18) + %23 = load i64, ptr %3, align 4 + %24 = trunc i64 %23 to i1 + br i1 %24, label %__barray_mask_return.exit730, label %panic.i729 + +panic.i729: ; preds = %__barray_mask_borrow.exit726 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit488: ; preds = %__barray_mask_borrow.exit486 - %26 = and i64 %24, -3 - store i64 %26, ptr %1, align 4 - store i64 %23, ptr %8, align 4 - %27 = load i64, ptr %1, align 4 - %28 = trunc i64 %27 to i1 - br i1 %28, label %panic.i489, label %__barray_mask_borrow.exit490 +__barray_mask_return.exit730: ; preds = %__barray_mask_borrow.exit726 + %25 = and i64 %23, -2 + store i64 %25, ptr %3, align 4 + store i64 %18, ptr %2, align 4 + %26 = load i64, ptr %3, align 4 + %27 = and i64 %26, 4 + %.not779 = icmp eq i64 %27, 0 + br i1 %.not779, label %__barray_mask_borrow.exit732, label %panic.i731 -panic.i489: ; preds = %__barray_mask_return.exit488 +panic.i731: ; preds = %__barray_mask_return.exit730 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit490: ; preds = %__barray_mask_return.exit488 - %29 = or disjoint i64 %27, 1 - store i64 %29, ptr %1, align 4 - %30 = load i64, ptr %0, align 4 - %31 = and i64 %27, 2 - %.not546 = icmp eq i64 %31, 0 - br i1 %.not546, label %__barray_mask_borrow.exit492, label %panic.i491 - -panic.i491: ; preds = %__barray_mask_borrow.exit490 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit492: ; preds = %__barray_mask_borrow.exit490 - %32 = or disjoint i64 %27, 3 - store i64 %32, ptr %1, align 4 - %33 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %30, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %30, i64 %33, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %33, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %30, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %30, double 0xBFF921FB54442D18) - %34 = load i64, ptr %1, align 4 - %35 = trunc i64 %34 to i1 - br i1 %35, label %__barray_mask_return.exit494, label %panic.i493 - -panic.i493: ; preds = %__barray_mask_borrow.exit492 +__barray_mask_borrow.exit732: ; preds = %__barray_mask_return.exit730 + %28 = or disjoint i64 %26, 4 + store i64 %28, ptr %3, align 4 + %29 = load i64, ptr %14, align 4 + tail call void @___rp(i64 %22, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %22, i64 %29, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %29, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %22, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %22, double 0xBFF921FB54442D18) + %30 = load i64, ptr %3, align 4 + %31 = and i64 %30, 2 + %.not780 = icmp eq i64 %31, 0 + br i1 %.not780, label %panic.i735, label %__barray_mask_return.exit736 + +panic.i735: ; preds = %__barray_mask_borrow.exit732 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit494: ; preds = %__barray_mask_borrow.exit492 - %36 = and i64 %34, -2 - store i64 %36, ptr %1, align 4 - store i64 %30, ptr %0, align 4 - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 2 - %.not547 = icmp eq i64 %38, 0 - br i1 %.not547, label %panic.i495, label %__barray_mask_return.exit496 +__barray_mask_return.exit736: ; preds = %__barray_mask_borrow.exit732 + %32 = and i64 %30, -3 + store i64 %32, ptr %3, align 4 + store i64 %22, ptr %10, align 4 + %33 = load i64, ptr %3, align 4 + %34 = and i64 %33, 4 + %.not781 = icmp eq i64 %34, 0 + br i1 %.not781, label %panic.i737, label %__barray_mask_return.exit738 -panic.i495: ; preds = %__barray_mask_return.exit494 +panic.i737: ; preds = %__barray_mask_return.exit736 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit496: ; preds = %__barray_mask_return.exit494 - %39 = and i64 %37, -3 - store i64 %39, ptr %1, align 4 - store i64 %33, ptr %8, align 4 - %40 = load i64, ptr %1, align 4 - %41 = trunc i64 %40 to i1 - br i1 %41, label %panic.i497, label %__barray_mask_borrow.exit498 - -panic.i497: ; preds = %__barray_mask_return.exit496 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit498: ; preds = %__barray_mask_return.exit496 - %42 = or disjoint i64 %40, 1 - store i64 %42, ptr %1, align 4 - %43 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %43, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %43, double 0x400921FB54442D18) - %44 = load i64, ptr %1, align 4 - %45 = trunc i64 %44 to i1 - br i1 %45, label %__barray_mask_return.exit500, label %panic.i499 - -panic.i499: ; preds = %__barray_mask_borrow.exit498 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit500: ; preds = %__barray_mask_borrow.exit498 - %46 = and i64 %44, -2 - store i64 %46, ptr %1, align 4 - store i64 %43, ptr %0, align 4 - %47 = load i64, ptr %1, align 4 - %48 = and i64 %47, 2 - %.not548 = icmp eq i64 %48, 0 - br i1 %.not548, label %__barray_mask_borrow.exit502, label %panic.i501 - -panic.i501: ; preds = %__barray_mask_return.exit500 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_return.exit738: ; preds = %__barray_mask_return.exit736 + %35 = and i64 %33, -5 + store i64 %35, ptr %3, align 4 + store i64 %29, ptr %14, align 4 + %36 = load i64, ptr %3, align 4 + %37 = trunc i64 %36 to i1 + br i1 %37, label %panic.i745, label %.thread -__barray_mask_borrow.exit502: ; preds = %__barray_mask_return.exit500 - %49 = or disjoint i64 %47, 2 - store i64 %49, ptr %1, align 4 - %50 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %50, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %50, double 0x400921FB54442D18) - %51 = load i64, ptr %1, align 4 - %52 = and i64 %51, 2 - %.not549 = icmp eq i64 %52, 0 - br i1 %.not549, label %panic.i503, label %__barray_mask_return.exit504 - -panic.i503: ; preds = %__barray_mask_borrow.exit502 +panic.i741: ; preds = %__barray_check_bounds.exit740.2, %.thread.1, %.thread tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit504: ; preds = %__barray_mask_borrow.exit502 - %53 = and i64 %51, -3 - store i64 %53, ptr %1, align 4 - store i64 %50, ptr %8, align 4 - %54 = load i64, ptr %1, align 4 - %55 = trunc i64 %54 to i1 - br i1 %55, label %panic.i505, label %__barray_mask_borrow.exit506 +loop_out191: ; preds = %cond_exit_180.2 + tail call void @heap_free(ptr nonnull %2) + tail call void @heap_free(ptr nonnull %3) + %38 = load i64, ptr %1, align 4 + %39 = trunc i64 %38 to i1 + br i1 %39, label %panic.i747, label %__barray_mask_borrow.exit748 -panic.i505: ; preds = %__barray_mask_return.exit504 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +mask_block_err.i: ; preds = %cond_exit_180.2 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit506: ; preds = %__barray_mask_return.exit504 - %56 = or disjoint i64 %54, 1 - store i64 %56, ptr %1, align 4 - %57 = load i64, ptr %0, align 4 - %58 = and i64 %54, 2 - %.not550 = icmp eq i64 %58, 0 - br i1 %.not550, label %__barray_mask_borrow.exit508, label %panic.i507 - -panic.i507: ; preds = %__barray_mask_borrow.exit506 +panic.i745: ; preds = %__barray_check_bounds.exit744.2, %cond_exit_180, %__barray_mask_return.exit738 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit508: ; preds = %__barray_mask_borrow.exit506 - %59 = or disjoint i64 %54, 3 +.thread: ; preds = %__barray_mask_return.exit738 + %40 = or disjoint i64 %36, 1 + store i64 %40, ptr %3, align 4 + %41 = load i64, ptr %2, align 4 + %lazy_measure = tail call i64 @___lazy_measure(i64 %41) + tail call void @___qfree(i64 %41) + %42 = load i64, ptr %1, align 4 + %43 = trunc i64 %42 to i1 + br i1 %43, label %cond_exit_180, label %panic.i741 + +cond_exit_180: ; preds = %.thread + %44 = and i64 %42, -2 + store i64 %44, ptr %1, align 4 + store i64 %lazy_measure, ptr %0, align 4 + %45 = load i64, ptr %3, align 4 + %46 = and i64 %45, 2 + %.not791 = icmp eq i64 %46, 0 + br i1 %.not791, label %.thread.1, label %panic.i745 + +.thread.1: ; preds = %cond_exit_180 + %47 = or disjoint i64 %45, 2 + store i64 %47, ptr %3, align 4 + %48 = load i64, ptr %10, align 4 + %lazy_measure.1 = tail call i64 @___lazy_measure(i64 %48) + tail call void @___qfree(i64 %48) + %49 = load i64, ptr %1, align 4 + %50 = and i64 %49, 2 + %.not792 = icmp eq i64 %50, 0 + br i1 %.not792, label %panic.i741, label %__barray_check_bounds.exit744.2 + +__barray_check_bounds.exit744.2: ; preds = %.thread.1 + %51 = and i64 %49, -3 + store i64 %51, ptr %1, align 4 + %52 = getelementptr inbounds nuw i8, ptr %0, i64 8 + store i64 %lazy_measure.1, ptr %52, align 4 + %53 = load i64, ptr %3, align 4 + %54 = and i64 %53, 4 + %.not793 = icmp eq i64 %54, 0 + br i1 %.not793, label %__barray_check_bounds.exit740.2, label %panic.i745 + +__barray_check_bounds.exit740.2: ; preds = %__barray_check_bounds.exit744.2 + %55 = or disjoint i64 %53, 4 + store i64 %55, ptr %3, align 4 + %56 = load i64, ptr %14, align 4 + %lazy_measure.2 = tail call i64 @___lazy_measure(i64 %56) + tail call void @___qfree(i64 %56) + %57 = load i64, ptr %1, align 4 + %58 = and i64 %57, 4 + %.not794 = icmp eq i64 %58, 0 + br i1 %.not794, label %panic.i741, label %cond_exit_180.2 + +cond_exit_180.2: ; preds = %__barray_check_bounds.exit740.2 + %59 = and i64 %57, -5 store i64 %59, ptr %1, align 4 - %60 = load i64, ptr %8, align 4 - tail call void @___rp(i64 %57, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %57, i64 %60, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %60, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %57, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %57, double 0xBFF921FB54442D18) - %61 = load i64, ptr %1, align 4 - %62 = trunc i64 %61 to i1 - br i1 %62, label %__barray_mask_return.exit512, label %panic.i511 - -panic.i511: ; preds = %__barray_mask_borrow.exit508 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit512: ; preds = %__barray_mask_borrow.exit508 - %63 = and i64 %61, -2 - store i64 %63, ptr %1, align 4 - store i64 %57, ptr %0, align 4 - %64 = load i64, ptr %1, align 4 - %65 = and i64 %64, 2 - %.not551 = icmp eq i64 %65, 0 - br i1 %.not551, label %panic.i513, label %__barray_mask_return.exit514 - -panic.i513: ; preds = %__barray_mask_return.exit512 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit514: ; preds = %__barray_mask_return.exit512 - %66 = and i64 %64, -3 - store i64 %66, ptr %1, align 4 - store i64 %60, ptr %8, align 4 - %67 = load i64, ptr %1, align 4 - %68 = and i64 %67, 2 - %.not552 = icmp eq i64 %68, 0 - br i1 %.not552, label %__barray_mask_borrow.exit516, label %panic.i515 - -panic.i515: ; preds = %__barray_mask_return.exit514 + %60 = getelementptr inbounds nuw i8, ptr %0, i64 16 + store i64 %lazy_measure.2, ptr %60, align 4 + %61 = load i64, ptr %3, align 4 + %62 = or i64 %61, -8 + store i64 %62, ptr %3, align 4 + %63 = icmp eq i64 %62, -1 + br i1 %63, label %loop_out191, label %mask_block_err.i + +panic.i747: ; preds = %loop_out191 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit516: ; preds = %__barray_mask_return.exit514 - %69 = or disjoint i64 %67, 2 - store i64 %69, ptr %1, align 4 - %70 = load i64, ptr %8, align 4 - %71 = and i64 %67, 4 - %.not553 = icmp eq i64 %71, 0 - br i1 %.not553, label %__barray_mask_borrow.exit518, label %panic.i517 - -panic.i517: ; preds = %__barray_mask_borrow.exit516 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable +__barray_mask_borrow.exit748: ; preds = %loop_out191 + %64 = or disjoint i64 %38, 1 + store i64 %64, ptr %1, align 4 + %65 = load i64, ptr %0, align 4 + tail call void @___inc_future_refcount(i64 %65) + %66 = load i64, ptr %1, align 4 + %67 = trunc i64 %66 to i1 + br i1 %67, label %__barray_mask_return.exit750, label %panic.i749 -__barray_mask_borrow.exit518: ; preds = %__barray_mask_borrow.exit516 - %72 = or disjoint i64 %67, 6 - store i64 %72, ptr %1, align 4 - %73 = load i64, ptr %12, align 4 - tail call void @___rp(i64 %70, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %70, i64 %73, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %73, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %70, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %70, double 0xBFF921FB54442D18) - %74 = load i64, ptr %1, align 4 - %75 = and i64 %74, 2 - %.not554 = icmp eq i64 %75, 0 - br i1 %.not554, label %panic.i521, label %__barray_mask_return.exit522 - -panic.i521: ; preds = %__barray_mask_borrow.exit518 +panic.i749: ; preds = %__barray_mask_borrow.exit748 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit522: ; preds = %__barray_mask_borrow.exit518 - %76 = and i64 %74, -3 - store i64 %76, ptr %1, align 4 - store i64 %70, ptr %8, align 4 - %77 = load i64, ptr %1, align 4 - %78 = and i64 %77, 4 - %.not555 = icmp eq i64 %78, 0 - br i1 %.not555, label %panic.i523, label %__barray_mask_return.exit524 +__barray_mask_return.exit750: ; preds = %__barray_mask_borrow.exit748 + %68 = and i64 %66, -2 + store i64 %68, ptr %1, align 4 + store i64 %65, ptr %0, align 4 + %69 = load i64, ptr %1, align 4 + %70 = and i64 %69, 2 + %.not782 = icmp eq i64 %70, 0 + br i1 %.not782, label %__barray_mask_borrow.exit752, label %panic.i751 -panic.i523: ; preds = %__barray_mask_return.exit522 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit524: ; preds = %__barray_mask_return.exit522 - %79 = and i64 %77, -5 - store i64 %79, ptr %1, align 4 - store i64 %73, ptr %12, align 4 - %80 = tail call ptr @heap_alloc(i64 24) - %81 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %81, align 1 - %82 = load i64, ptr %1, align 4 - %83 = trunc i64 %82 to i1 - br i1 %83, label %panic.i.i.i, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - -"__hugr__.guppylang.std.quantum.measure_array$3.243.exit": ; preds = %loop_body.2.i - tail call void @heap_free(ptr nonnull %0) - tail call void @heap_free(ptr nonnull %1) - %84 = load i64, ptr %81, align 4 - %85 = trunc i64 %84 to i1 - br i1 %85, label %panic.i525, label %__barray_mask_borrow.exit526 - -mask_block_err.i.i.i: ; preds = %loop_body.2.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.2.i, %loop_body.i, %__barray_mask_return.exit524 +panic.i751: ; preds = %__barray_mask_return.exit750 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i": ; preds = %__barray_mask_return.exit524 - %86 = or disjoint i64 %82, 1 - store i64 %86, ptr %1, align 4 - %87 = load i64, ptr %0, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %87) - tail call void @___qfree(i64 %87) - %88 = load i64, ptr %81, align 4 - %89 = trunc i64 %88 to i1 - br i1 %89, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.2.i, %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit752: ; preds = %__barray_mask_return.exit750 + %71 = or disjoint i64 %69, 2 + store i64 %71, ptr %1, align 4 + %72 = load i64, ptr %52, align 4 + tail call void @___inc_future_refcount(i64 %72) + %73 = load i64, ptr %1, align 4 + %74 = and i64 %73, 2 + %.not783 = icmp eq i64 %74, 0 + br i1 %.not783, label %panic.i753, label %__barray_mask_return.exit754 -loop_body.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.i" - %90 = and i64 %88, -2 - store i64 %90, ptr %81, align 4 - store i64 %lazy_measure.i, ptr %80, align 4 - %91 = load i64, ptr %1, align 4 - %92 = and i64 %91, 2 - %.not556 = icmp eq i64 %92, 0 - br i1 %.not556, label %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i", label %panic.i.i.i - -"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i": ; preds = %loop_body.i - %93 = or disjoint i64 %91, 2 - store i64 %93, ptr %1, align 4 - %94 = load i64, ptr %8, align 4 - %lazy_measure.1.i = tail call i64 @___lazy_measure(i64 %94) - tail call void @___qfree(i64 %94) - %95 = load i64, ptr %81, align 4 - %96 = and i64 %95, 2 - %.not.i = icmp eq i64 %96, 0 - br i1 %.not.i, label %panic.i.i, label %__barray_check_bounds.exit.i.2.i - -__barray_check_bounds.exit.i.2.i: ; preds = %"__hugr__.guppylang.std.array.ArrayIter.__next__$qubit&3.296.exit.thread.1.i" - %97 = and i64 %95, -3 - store i64 %97, ptr %81, align 4 - %98 = getelementptr inbounds nuw i8, ptr %80, i64 8 - store i64 %lazy_measure.1.i, ptr %98, align 4 - %99 = load i64, ptr %1, align 4 - %100 = and i64 %99, 4 - %.not557 = icmp eq i64 %100, 0 - br i1 %.not557, label %__barray_check_bounds.exit.2.i, label %panic.i.i.i - -__barray_check_bounds.exit.2.i: ; preds = %__barray_check_bounds.exit.i.2.i - %101 = or disjoint i64 %99, 4 - store i64 %101, ptr %1, align 4 - %102 = load i64, ptr %12, align 4 - %lazy_measure.2.i = tail call i64 @___lazy_measure(i64 %102) - tail call void @___qfree(i64 %102) - %103 = load i64, ptr %81, align 4 - %104 = and i64 %103, 4 - %.not182.i = icmp eq i64 %104, 0 - br i1 %.not182.i, label %panic.i.i, label %loop_body.2.i - -loop_body.2.i: ; preds = %__barray_check_bounds.exit.2.i - %105 = and i64 %103, -5 - store i64 %105, ptr %81, align 4 - %106 = getelementptr inbounds nuw i8, ptr %80, i64 16 - store i64 %lazy_measure.2.i, ptr %106, align 4 - %107 = load i64, ptr %1, align 4 - %108 = or i64 %107, -8 - store i64 %108, ptr %1, align 4 - %109 = icmp eq i64 %108, -1 - br i1 %109, label %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit", label %mask_block_err.i.i.i - -panic.i525: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit526: ; preds = %"__hugr__.guppylang.std.quantum.measure_array$3.243.exit" - %110 = or disjoint i64 %84, 1 - store i64 %110, ptr %81, align 4 - %111 = load i64, ptr %80, align 4 - tail call void @___inc_future_refcount(i64 %111) - %112 = load i64, ptr %81, align 4 - %113 = trunc i64 %112 to i1 - br i1 %113, label %__barray_mask_return.exit528, label %panic.i527 - -panic.i527: ; preds = %__barray_mask_borrow.exit526 +panic.i753: ; preds = %__barray_mask_borrow.exit752 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit528: ; preds = %__barray_mask_borrow.exit526 - %114 = and i64 %112, -2 - store i64 %114, ptr %81, align 4 - store i64 %111, ptr %80, align 4 - %115 = load i64, ptr %81, align 4 - %116 = and i64 %115, 2 - %.not558 = icmp eq i64 %116, 0 - br i1 %.not558, label %__barray_mask_borrow.exit530, label %panic.i529 +__barray_mask_return.exit754: ; preds = %__barray_mask_borrow.exit752 + %75 = and i64 %73, -3 + store i64 %75, ptr %1, align 4 + store i64 %72, ptr %52, align 4 + %76 = load i64, ptr %1, align 4 + %77 = and i64 %76, 4 + %.not784 = icmp eq i64 %77, 0 + br i1 %.not784, label %__barray_mask_borrow.exit756, label %panic.i755 -panic.i529: ; preds = %__barray_mask_return.exit528 +panic.i755: ; preds = %__barray_mask_return.exit754 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit530: ; preds = %__barray_mask_return.exit528 - %117 = or disjoint i64 %115, 2 - store i64 %117, ptr %81, align 4 - %118 = load i64, ptr %98, align 4 - tail call void @___inc_future_refcount(i64 %118) - %119 = load i64, ptr %81, align 4 - %120 = and i64 %119, 2 - %.not559 = icmp eq i64 %120, 0 - br i1 %.not559, label %panic.i531, label %__barray_mask_return.exit532 - -panic.i531: ; preds = %__barray_mask_borrow.exit530 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +__barray_mask_borrow.exit756: ; preds = %__barray_mask_return.exit754 + %78 = or disjoint i64 %76, 4 + store i64 %78, ptr %1, align 4 + %79 = load i64, ptr %60, align 4 + tail call void @___inc_future_refcount(i64 %79) + %80 = load i64, ptr %1, align 4 + %81 = and i64 %80, 4 + %.not785 = icmp eq i64 %81, 0 + br i1 %.not785, label %panic.i757, label %__barray_mask_return.exit758 -__barray_mask_return.exit532: ; preds = %__barray_mask_borrow.exit530 - %121 = and i64 %119, -3 - store i64 %121, ptr %81, align 4 - store i64 %118, ptr %98, align 4 - %122 = load i64, ptr %81, align 4 - %123 = and i64 %122, 4 - %.not560 = icmp eq i64 %123, 0 - br i1 %.not560, label %__barray_mask_borrow.exit534, label %panic.i533 - -panic.i533: ; preds = %__barray_mask_return.exit532 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_mask_borrow.exit534: ; preds = %__barray_mask_return.exit532 - %124 = or disjoint i64 %122, 4 - store i64 %124, ptr %81, align 4 - %125 = load i64, ptr %106, align 4 - tail call void @___inc_future_refcount(i64 %125) - %126 = load i64, ptr %81, align 4 - %127 = and i64 %126, 4 - %.not561 = icmp eq i64 %127, 0 - br i1 %.not561, label %panic.i535, label %__barray_mask_return.exit536 - -panic.i535: ; preds = %__barray_mask_borrow.exit534 +panic.i757: ; preds = %__barray_mask_borrow.exit756 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit536: ; preds = %__barray_mask_borrow.exit534 - %128 = and i64 %126, -5 - store i64 %128, ptr %81, align 4 - store i64 %125, ptr %106, align 4 - %129 = load i64, ptr %81, align 4 - %130 = trunc i64 %129 to i1 - br i1 %130, label %cond_exit_546, label %__barray_mask_borrow.exit542 +__barray_mask_return.exit758: ; preds = %__barray_mask_borrow.exit756 + %82 = and i64 %80, -5 + store i64 %82, ptr %1, align 4 + store i64 %79, ptr %60, align 4 + %83 = load i64, ptr %1, align 4 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_425, label %__barray_mask_borrow.exit770 -mask_block_err.i: ; preds = %cond_exit_546.2 +mask_block_err.i762: ; preds = %cond_exit_425.2 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit542: ; preds = %__barray_mask_return.exit536 - %131 = or disjoint i64 %129, 1 - store i64 %131, ptr %81, align 4 - %132 = load i64, ptr %80, align 4 - tail call void @___dec_future_refcount(i64 %132) - br label %cond_exit_546 - -cond_exit_546: ; preds = %__barray_mask_borrow.exit542, %__barray_mask_return.exit536 - %133 = load i64, ptr %81, align 4 - %134 = and i64 %133, 2 - %.not568 = icmp eq i64 %134, 0 - br i1 %.not568, label %__barray_mask_borrow.exit542.1, label %cond_exit_546.1 - -__barray_mask_borrow.exit542.1: ; preds = %cond_exit_546 - %135 = or disjoint i64 %133, 2 - store i64 %135, ptr %81, align 4 - %136 = getelementptr inbounds nuw i8, ptr %80, i64 8 - %137 = load i64, ptr %136, align 4 - tail call void @___dec_future_refcount(i64 %137) - br label %cond_exit_546.1 - -cond_exit_546.1: ; preds = %__barray_mask_borrow.exit542.1, %cond_exit_546 - %138 = load i64, ptr %81, align 4 - %139 = and i64 %138, 4 - %.not569 = icmp eq i64 %139, 0 - br i1 %.not569, label %__barray_mask_borrow.exit542.2, label %cond_exit_546.2 - -__barray_mask_borrow.exit542.2: ; preds = %cond_exit_546.1 - %140 = or disjoint i64 %138, 4 - store i64 %140, ptr %81, align 4 - %141 = getelementptr inbounds nuw i8, ptr %80, i64 16 - %142 = load i64, ptr %141, align 4 - tail call void @___dec_future_refcount(i64 %142) - br label %cond_exit_546.2 - -cond_exit_546.2: ; preds = %__barray_mask_borrow.exit542.2, %cond_exit_546.1 - %143 = load i64, ptr %81, align 4 - %144 = or i64 %143, -8 - store i64 %144, ptr %81, align 4 - %145 = icmp eq i64 %144, -1 - br i1 %145, label %loop_out296, label %mask_block_err.i - -loop_out296: ; preds = %cond_exit_546.2 - tail call void @heap_free(ptr nonnull %80) - tail call void @heap_free(ptr nonnull %81) - %read_bool = tail call i1 @___read_future_bool(i64 %111) - tail call void @___dec_future_refcount(i64 %111) +__barray_mask_borrow.exit770: ; preds = %__barray_mask_return.exit758 + %85 = or disjoint i64 %83, 1 + store i64 %85, ptr %1, align 4 + %86 = load i64, ptr %0, align 4 + tail call void @___dec_future_refcount(i64 %86) + br label %cond_exit_425 + +cond_exit_425: ; preds = %__barray_mask_borrow.exit770, %__barray_mask_return.exit758 + %87 = load i64, ptr %1, align 4 + %88 = and i64 %87, 2 + %.not797 = icmp eq i64 %88, 0 + br i1 %.not797, label %__barray_mask_borrow.exit770.1, label %cond_exit_425.1 + +__barray_mask_borrow.exit770.1: ; preds = %cond_exit_425 + %89 = or disjoint i64 %87, 2 + store i64 %89, ptr %1, align 4 + %90 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %91 = load i64, ptr %90, align 4 + tail call void @___dec_future_refcount(i64 %91) + br label %cond_exit_425.1 + +cond_exit_425.1: ; preds = %__barray_mask_borrow.exit770.1, %cond_exit_425 + %92 = load i64, ptr %1, align 4 + %93 = and i64 %92, 4 + %.not798 = icmp eq i64 %93, 0 + br i1 %.not798, label %__barray_mask_borrow.exit770.2, label %cond_exit_425.2 + +__barray_mask_borrow.exit770.2: ; preds = %cond_exit_425.1 + %94 = or disjoint i64 %92, 4 + store i64 %94, ptr %1, align 4 + %95 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %96 = load i64, ptr %95, align 4 + tail call void @___dec_future_refcount(i64 %96) + br label %cond_exit_425.2 + +cond_exit_425.2: ; preds = %__barray_mask_borrow.exit770.2, %cond_exit_425.1 + %97 = load i64, ptr %1, align 4 + %98 = or i64 %97, -8 + store i64 %98, ptr %1, align 4 + %99 = icmp eq i64 %98, -1 + br i1 %99, label %loop_out415, label %mask_block_err.i762 + +loop_out415: ; preds = %cond_exit_425.2 + tail call void @heap_free(ptr nonnull %0) + tail call void @heap_free(ptr nonnull %1) + %read_bool = tail call i1 @___read_future_bool(i64 %65) + tail call void @___dec_future_refcount(i64 %65) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %read_bool365 = tail call i1 @___read_future_bool(i64 %118) - tail call void @___dec_future_refcount(i64 %118) - tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool365) - %read_bool380 = tail call i1 @___read_future_bool(i64 %125) - tail call void @___dec_future_refcount(i64 %125) - tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool380) + %read_bool484 = tail call i1 @___read_future_bool(i64 %72) + tail call void @___dec_future_refcount(i64 %72) + tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool484) + %read_bool499 = tail call i1 @___read_future_bool(i64 %79) + tail call void @___dec_future_refcount(i64 %79) + tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool499) ret void } @@ -573,20 +400,20 @@ declare ptr @heap_alloc(i64) local_unnamed_addr ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #0 -declare void @___inc_future_refcount(i64) local_unnamed_addr - declare void @heap_free(ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr + +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr + declare void @___dec_future_refcount(i64) local_unnamed_addr declare i1 @___read_future_bool(i64) local_unnamed_addr declare void @print_bool(ptr, i64, i1) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr - -declare void @___qfree(i64) local_unnamed_addr - declare void @___rp(i64, double, double) local_unnamed_addr declare void @___rpp(i64, i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-apple-darwin.ll index a251a3e8..a47b5a2e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "aarch64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-unknown-linux-gnu.ll index 71584c05..42cfcc76 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-aarch64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-apple-darwin.ll index 8203c197..dc0cedda 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "x86_64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-unknown-linux-gnu.ll index cf72ec6c..71be0d68 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-windows-gnu.ll index 1ab4001b..d010367f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-helios-x86_64-windows-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-windows-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-apple-darwin.ll index 46d37de4..eeca75f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "aarch64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-unknown-linux-gnu.ll index 8e7e6a04..3364ed5e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-aarch64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-apple-darwin.ll index 1f04880f..bd9e68a5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "x86_64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-unknown-linux-gnu.ll index 8fb1fe44..a32c01cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-windows-gnu.ll index 05f9df4b..7c30514a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_timeout/test_timeout/non_terminating_with_results-sol-x86_64-windows-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-windows-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-apple-darwin.ll index 7c7ef212..345fa847 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-apple-darwin.ll @@ -3,721 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit + br i1 %not_max.not.not.i, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit -cond_492_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_442_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.465.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.438.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.465.exit.8, %__hugr__.__tk2_helios_qalloc.465.exit.7, %__hugr__.__tk2_helios_qalloc.465.exit.6, %__hugr__.__tk2_helios_qalloc.465.exit.5, %__hugr__.__tk2_helios_qalloc.465.exit.4, %__hugr__.__tk2_helios_qalloc.465.exit.3, %__hugr__.__tk2_helios_qalloc.465.exit.2, %__hugr__.__tk2_helios_qalloc.465.exit.1, %__hugr__.__tk2_helios_qalloc.465.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.438.exit.8, %__hugr__.__tk2_helios_qalloc.438.exit.7, %__hugr__.__tk2_helios_qalloc.438.exit.6, %__hugr__.__tk2_helios_qalloc.438.exit.5, %__hugr__.__tk2_helios_qalloc.438.exit.4, %__hugr__.__tk2_helios_qalloc.438.exit.3, %__hugr__.__tk2_helios_qalloc.438.exit.2, %__hugr__.__tk2_helios_qalloc.438.exit.1, %__hugr__.__tk2_helios_qalloc.438.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.1 + br i1 %not_max.not.not.i.1, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.1 -__hugr__.__tk2_helios_qalloc.465.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.438.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.2 + br i1 %not_max.not.not.i.2, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.2 -__hugr__.__tk2_helios_qalloc.465.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.438.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not416 = icmp eq i64 %10, 0 - br i1 %.not416, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1192 = icmp eq i64 %14, 0 + br i1 %.not1192, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.3 + br i1 %not_max.not.not.i.3, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.3 -__hugr__.__tk2_helios_qalloc.465.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.438.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not417 = icmp eq i64 %14, 0 - br i1 %.not417, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1193 = icmp eq i64 %18, 0 + br i1 %.not1193, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.4 + br i1 %not_max.not.not.i.4, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.4 -__hugr__.__tk2_helios_qalloc.465.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.438.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not418 = icmp eq i64 %18, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1194 = icmp eq i64 %22, 0 + br i1 %.not1194, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.5 + br i1 %not_max.not.not.i.5, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.5 -__hugr__.__tk2_helios_qalloc.465.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.438.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not419 = icmp eq i64 %22, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1195 = icmp eq i64 %26, 0 + br i1 %.not1195, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.6 + br i1 %not_max.not.not.i.6, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.6 -__hugr__.__tk2_helios_qalloc.465.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.438.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not420 = icmp eq i64 %26, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1196 = icmp eq i64 %30, 0 + br i1 %.not1196, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.7 + br i1 %not_max.not.not.i.7, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.7 -__hugr__.__tk2_helios_qalloc.465.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.438.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not421 = icmp eq i64 %30, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1197 = icmp eq i64 %34, 0 + br i1 %.not1197, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.8 + br i1 %not_max.not.not.i.8, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.8 -__hugr__.__tk2_helios_qalloc.465.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.438.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not422 = icmp eq i64 %34, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1198 = icmp eq i64 %38, 0 + br i1 %.not1198, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_492_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_442_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not423 = icmp eq i64 %38, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1199 = icmp eq i64 %42, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0415" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0415", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0415" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0415" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0415" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0415" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rxy(i64 %61, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %55, i64 %61, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %61, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %61, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0415" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rxy(i64 %65, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %59, i64 %65, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %65, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %65, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond.not = icmp eq i64 %48, 9 - br i1 %exitcond.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond = icmp eq i64 %74, 10 + br i1 %exitcond, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01203" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"512_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 2 - %"512_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 1 - %"512_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 0 - %118 = lshr i64 %"512_1.sroa.10.0.i.i", 6 - %119 = getelementptr i64, ptr %"512_1.sroa.5.0.i.i", i64 %118 - %120 = load i64, ptr %119, align 4 - %121 = and i64 %"512_1.sroa.10.0.i.i", 63 - %122 = lshr i64 %120, %121 - %123 = trunc i64 %122 to i1 - br i1 %123, label %cond_exit_515.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %266, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %125, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %262, %loop_body.i386 ] - %125 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i398, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i398: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01204" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01203" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01204", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01204" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01204" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01204" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01203", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01203", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01203" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01203" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01204", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -140: ; preds = %mask_block_ok.i.i.i390 - %141 = add nuw i64 %.02.i.i.i391, 1 - %exitcond.not.i.i.i394 = icmp eq i64 %.02.i.i.i391, %reass.sub.i.i.i388 - br i1 %exitcond.not.i.i.i394, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 -mask_block_ok.i.i.i390: ; preds = %cond_exit_515.thread.9.i.i, %140 - %.02.i.i.i391 = phi i64 [ %141, %140 ], [ 0, %cond_exit_515.thread.9.i.i ] - %gep.i.i.i392 = getelementptr i64, ptr %119, i64 %.02.i.i.i391 - %142 = load i64, ptr %gep.i.i.i392, align 4 - %143 = icmp eq i64 %142, -1 - br i1 %143, label %140, label %mask_block_err.i.i.i393 +panic.i1154: ; preds = %__barray_check_bounds.exit1153 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i393: ; preds = %mask_block_ok.i.i.i390 +mask_block_err.i1159: ; preds = %cond_exit_488.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %144 = shl nuw i64 1, %121 - %145 = xor i64 %120, %144 - store i64 %145, ptr %119, align 4 - %146 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %"512_1.sroa.10.0.i.i" - %147 = load i64, ptr %146, align 4 - tail call void @___dec_future_refcount(i64 %147) - br label %cond_exit_515.thread.i.i - -cond_exit_515.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %148 = add i64 %"512_1.sroa.10.0.i.i", 1 - %149 = lshr i64 %148, 6 - %150 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %148, 63 - %153 = lshr i64 %151, %152 - %154 = trunc i64 %153 to i1 - br i1 %154, label %cond_exit_515.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_515.thread.i.i - %155 = shl nuw i64 1, %152 - %156 = xor i64 %151, %155 - store i64 %156, ptr %150, align 4 - %157 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %148 - %158 = load i64, ptr %157, align 4 - tail call void @___dec_future_refcount(i64 %158) - br label %cond_exit_515.thread.1.i.i - -cond_exit_515.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_515.thread.i.i - %159 = add i64 %"512_1.sroa.10.0.i.i", 2 - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %cond_exit_515.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_515.thread.1.i.i - %166 = shl nuw i64 1, %163 - %167 = xor i64 %162, %166 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___dec_future_refcount(i64 %169) - br label %cond_exit_515.thread.2.i.i - -cond_exit_515.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_515.thread.1.i.i - %170 = add i64 %"512_1.sroa.10.0.i.i", 3 - %171 = lshr i64 %170, 6 - %172 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %171 - %173 = load i64, ptr %172, align 4 - %174 = and i64 %170, 63 - %175 = lshr i64 %173, %174 - %176 = trunc i64 %175 to i1 - br i1 %176, label %cond_exit_515.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_515.thread.2.i.i - %177 = shl nuw i64 1, %174 - %178 = xor i64 %173, %177 - store i64 %178, ptr %172, align 4 - %179 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %170 - %180 = load i64, ptr %179, align 4 - tail call void @___dec_future_refcount(i64 %180) - br label %cond_exit_515.thread.3.i.i - -cond_exit_515.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_515.thread.2.i.i - %181 = add i64 %"512_1.sroa.10.0.i.i", 4 - %182 = lshr i64 %181, 6 - %183 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %181, 63 - %186 = lshr i64 %184, %185 - %187 = trunc i64 %186 to i1 - br i1 %187, label %cond_exit_515.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_515.thread.3.i.i - %188 = shl nuw i64 1, %185 - %189 = xor i64 %184, %188 - store i64 %189, ptr %183, align 4 - %190 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %181 - %191 = load i64, ptr %190, align 4 - tail call void @___dec_future_refcount(i64 %191) - br label %cond_exit_515.thread.4.i.i - -cond_exit_515.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_515.thread.3.i.i - %192 = add i64 %"512_1.sroa.10.0.i.i", 5 - %193 = lshr i64 %192, 6 - %194 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %193 - %195 = load i64, ptr %194, align 4 - %196 = and i64 %192, 63 - %197 = lshr i64 %195, %196 - %198 = trunc i64 %197 to i1 - br i1 %198, label %cond_exit_515.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_515.thread.4.i.i - %199 = shl nuw i64 1, %196 - %200 = xor i64 %195, %199 - store i64 %200, ptr %194, align 4 - %201 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %192 - %202 = load i64, ptr %201, align 4 - tail call void @___dec_future_refcount(i64 %202) - br label %cond_exit_515.thread.5.i.i - -cond_exit_515.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_515.thread.4.i.i - %203 = add i64 %"512_1.sroa.10.0.i.i", 6 - %204 = lshr i64 %203, 6 - %205 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %204 - %206 = load i64, ptr %205, align 4 - %207 = and i64 %203, 63 - %208 = lshr i64 %206, %207 - %209 = trunc i64 %208 to i1 - br i1 %209, label %cond_exit_515.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_515.thread.5.i.i - %210 = shl nuw i64 1, %207 - %211 = xor i64 %206, %210 - store i64 %211, ptr %205, align 4 - %212 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %203 - %213 = load i64, ptr %212, align 4 - tail call void @___dec_future_refcount(i64 %213) - br label %cond_exit_515.thread.6.i.i - -cond_exit_515.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_515.thread.5.i.i - %214 = add i64 %"512_1.sroa.10.0.i.i", 7 - %215 = lshr i64 %214, 6 - %216 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %215 - %217 = load i64, ptr %216, align 4 - %218 = and i64 %214, 63 - %219 = lshr i64 %217, %218 - %220 = trunc i64 %219 to i1 - br i1 %220, label %cond_exit_515.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_515.thread.6.i.i - %221 = shl nuw i64 1, %218 - %222 = xor i64 %217, %221 - store i64 %222, ptr %216, align 4 - %223 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %214 - %224 = load i64, ptr %223, align 4 - tail call void @___dec_future_refcount(i64 %224) - br label %cond_exit_515.thread.7.i.i - -cond_exit_515.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_515.thread.6.i.i - %225 = add i64 %"512_1.sroa.10.0.i.i", 8 - %226 = lshr i64 %225, 6 - %227 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %226 - %228 = load i64, ptr %227, align 4 - %229 = and i64 %225, 63 - %230 = lshr i64 %228, %229 - %231 = trunc i64 %230 to i1 - br i1 %231, label %cond_exit_515.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_515.thread.7.i.i - %232 = shl nuw i64 1, %229 - %233 = xor i64 %228, %232 - store i64 %233, ptr %227, align 4 - %234 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %225 - %235 = load i64, ptr %234, align 4 - tail call void @___dec_future_refcount(i64 %235) - br label %cond_exit_515.thread.8.i.i - -cond_exit_515.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_515.thread.7.i.i - %236 = add i64 %"512_1.sroa.10.0.i.i", 9 - %237 = lshr i64 %236, 6 - %238 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %237 - %239 = load i64, ptr %238, align 4 - %240 = and i64 %236, 63 - %241 = lshr i64 %239, %240 - %242 = trunc i64 %241 to i1 - br i1 %242, label %cond_exit_515.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_515.thread.8.i.i - %243 = shl nuw i64 1, %240 - %244 = xor i64 %239, %243 - store i64 %244, ptr %238, align 4 - %245 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %236 - %246 = load i64, ptr %245, align 4 - tail call void @___dec_future_refcount(i64 %246) - br label %cond_exit_515.thread.9.i.i - -cond_exit_515.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_515.thread.8.i.i - %247 = load i64, ptr %119, align 4 - %248 = sub nuw nsw i64 64, %121 - %249 = lshr i64 -1, %248 - %250 = icmp eq i64 %121, 0 - %251 = select i1 %250, i64 0, i64 %249 - %252 = or i64 %247, %251 - store i64 %252, ptr %119, align 4 - %253 = load i64, ptr %238, align 4 - %254 = shl nsw i64 -2, %240 - %255 = icmp eq i64 %240, 63 - %256 = select i1 %255, i64 0, i64 %254 - %257 = or i64 %253, %256 - store i64 %257, ptr %238, align 4 - %reass.sub.i.i.i388 = sub nsw i64 %237, %118 - %.not.i.i.i389 = icmp eq i64 %reass.sub.i.i.i388, -1 - br i1 %.not.i.i.i389, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %258 = xor i64 %137, %133 - store i64 %258, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_488 + +cond_exit_488: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1206 = icmp eq i64 %113, 0 + br i1 %.not1206, label %__barray_mask_borrow.exit1167.1, label %cond_exit_488.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_488 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_488.1 + +cond_exit_488.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_488 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1207 = icmp eq i64 %118, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.2, label %cond_exit_488.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_488.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_488.2 + +cond_exit_488.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_488.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1208 = icmp eq i64 %123, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.3, label %cond_exit_488.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_488.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_488.3 + +cond_exit_488.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_488.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1209 = icmp eq i64 %128, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.4, label %cond_exit_488.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_488.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_488.4 + +cond_exit_488.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_488.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1210 = icmp eq i64 %133, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.5, label %cond_exit_488.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_488.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 tail call void @___dec_future_refcount(i64 %136) - %259 = load i64, ptr %117, align 4 - %260 = lshr i64 %259, %"229_0.sroa.15.0168.i" - %261 = trunc i64 %260 to i1 - br i1 %261, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %262 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %263 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %264 = xor i64 %259, %263 - store i64 %264, ptr %117, align 4 - %265 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %265, align 1 - %266 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %140, %cond_exit_515.thread.9.i.i - tail call void @heap_free(ptr %"512_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"512_1.sroa.5.0.i.i") - %267 = load i64, ptr %117, align 4 - %268 = and i64 %267, 1023 - store i64 %268, ptr %117, align 4 - %269 = icmp eq i64 %268, 0 - br i1 %269, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" + br label %cond_exit_488.5 + +cond_exit_488.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_488.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1211 = icmp eq i64 %138, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.6, label %cond_exit_488.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_488.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_488.6 + +cond_exit_488.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_488.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1212 = icmp eq i64 %143, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.7, label %cond_exit_488.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_488.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_488.7 + +cond_exit_488.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_488.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1213 = icmp eq i64 %148, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.8, label %cond_exit_488.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_488.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_488.8 + +cond_exit_488.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_488.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1214 = icmp eq i64 %153, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.9, label %cond_exit_488.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_488.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_488.9 + +cond_exit_488.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_488.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_488, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_488.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %270 = tail call ptr @heap_alloc(i64 10) - %271 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %271, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %270, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %270) - %272 = load i64, ptr %117, align 4 - %273 = and i64 %272, 1023 - store i64 %273, ptr %117, align 4 - %274 = icmp eq i64 %273, 0 - br i1 %274, label %__barray_check_none_borrowed.exit400, label %mask_block_err.i399 - -mask_block_err.i399: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %275 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %275, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %275, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -730,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-unknown-linux-gnu.ll index 1172f532..d818baaf 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-aarch64-unknown-linux-gnu.ll @@ -3,721 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit + br i1 %not_max.not.not.i, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit -cond_492_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_442_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.465.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.438.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.465.exit.8, %__hugr__.__tk2_helios_qalloc.465.exit.7, %__hugr__.__tk2_helios_qalloc.465.exit.6, %__hugr__.__tk2_helios_qalloc.465.exit.5, %__hugr__.__tk2_helios_qalloc.465.exit.4, %__hugr__.__tk2_helios_qalloc.465.exit.3, %__hugr__.__tk2_helios_qalloc.465.exit.2, %__hugr__.__tk2_helios_qalloc.465.exit.1, %__hugr__.__tk2_helios_qalloc.465.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.438.exit.8, %__hugr__.__tk2_helios_qalloc.438.exit.7, %__hugr__.__tk2_helios_qalloc.438.exit.6, %__hugr__.__tk2_helios_qalloc.438.exit.5, %__hugr__.__tk2_helios_qalloc.438.exit.4, %__hugr__.__tk2_helios_qalloc.438.exit.3, %__hugr__.__tk2_helios_qalloc.438.exit.2, %__hugr__.__tk2_helios_qalloc.438.exit.1, %__hugr__.__tk2_helios_qalloc.438.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.1 + br i1 %not_max.not.not.i.1, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.1 -__hugr__.__tk2_helios_qalloc.465.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.438.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.2 + br i1 %not_max.not.not.i.2, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.2 -__hugr__.__tk2_helios_qalloc.465.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.438.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not416 = icmp eq i64 %10, 0 - br i1 %.not416, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1192 = icmp eq i64 %14, 0 + br i1 %.not1192, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.3 + br i1 %not_max.not.not.i.3, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.3 -__hugr__.__tk2_helios_qalloc.465.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.438.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not417 = icmp eq i64 %14, 0 - br i1 %.not417, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1193 = icmp eq i64 %18, 0 + br i1 %.not1193, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.4 + br i1 %not_max.not.not.i.4, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.4 -__hugr__.__tk2_helios_qalloc.465.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.438.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not418 = icmp eq i64 %18, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1194 = icmp eq i64 %22, 0 + br i1 %.not1194, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.5 + br i1 %not_max.not.not.i.5, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.5 -__hugr__.__tk2_helios_qalloc.465.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.438.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not419 = icmp eq i64 %22, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1195 = icmp eq i64 %26, 0 + br i1 %.not1195, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.6 + br i1 %not_max.not.not.i.6, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.6 -__hugr__.__tk2_helios_qalloc.465.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.438.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not420 = icmp eq i64 %26, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1196 = icmp eq i64 %30, 0 + br i1 %.not1196, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.7 + br i1 %not_max.not.not.i.7, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.7 -__hugr__.__tk2_helios_qalloc.465.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.438.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not421 = icmp eq i64 %30, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1197 = icmp eq i64 %34, 0 + br i1 %.not1197, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_492_case_0.i, label %__hugr__.__tk2_helios_qalloc.465.exit.8 + br i1 %not_max.not.not.i.8, label %cond_442_case_0.i, label %__hugr__.__tk2_helios_qalloc.438.exit.8 -__hugr__.__tk2_helios_qalloc.465.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.438.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not422 = icmp eq i64 %34, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.465.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1198 = icmp eq i64 %38, 0 + br i1 %.not1198, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_helios_qalloc.438.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_492_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_442_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not423 = icmp eq i64 %38, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1199 = icmp eq i64 %42, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0415" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0415", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0415" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0415" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0415" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0415" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rxy(i64 %61, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %55, i64 %61, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %61, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %61, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0415" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rxy(i64 %65, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %59, i64 %65, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %65, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %65, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond.not = icmp eq i64 %48, 9 - br i1 %exitcond.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond = icmp eq i64 %74, 10 + br i1 %exitcond, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01203" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"512_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 2 - %"512_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 1 - %"512_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 0 - %118 = lshr i64 %"512_1.sroa.10.0.i.i", 6 - %119 = getelementptr i64, ptr %"512_1.sroa.5.0.i.i", i64 %118 - %120 = load i64, ptr %119, align 4 - %121 = and i64 %"512_1.sroa.10.0.i.i", 63 - %122 = lshr i64 %120, %121 - %123 = trunc i64 %122 to i1 - br i1 %123, label %cond_exit_515.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %266, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %125, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %262, %loop_body.i386 ] - %125 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i398, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i398: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01204" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01203" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01204", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01204" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01204" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01204" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01203", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01203", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01203" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01203" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01204", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -140: ; preds = %mask_block_ok.i.i.i390 - %141 = add nuw i64 %.02.i.i.i391, 1 - %exitcond.not.i.i.i394 = icmp eq i64 %.02.i.i.i391, %reass.sub.i.i.i388 - br i1 %exitcond.not.i.i.i394, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 -mask_block_ok.i.i.i390: ; preds = %cond_exit_515.thread.9.i.i, %140 - %.02.i.i.i391 = phi i64 [ %141, %140 ], [ 0, %cond_exit_515.thread.9.i.i ] - %gep.i.i.i392 = getelementptr i64, ptr %119, i64 %.02.i.i.i391 - %142 = load i64, ptr %gep.i.i.i392, align 4 - %143 = icmp eq i64 %142, -1 - br i1 %143, label %140, label %mask_block_err.i.i.i393 +panic.i1154: ; preds = %__barray_check_bounds.exit1153 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i393: ; preds = %mask_block_ok.i.i.i390 +mask_block_err.i1159: ; preds = %cond_exit_488.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %144 = shl nuw i64 1, %121 - %145 = xor i64 %120, %144 - store i64 %145, ptr %119, align 4 - %146 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %"512_1.sroa.10.0.i.i" - %147 = load i64, ptr %146, align 4 - tail call void @___dec_future_refcount(i64 %147) - br label %cond_exit_515.thread.i.i - -cond_exit_515.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %148 = add i64 %"512_1.sroa.10.0.i.i", 1 - %149 = lshr i64 %148, 6 - %150 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %148, 63 - %153 = lshr i64 %151, %152 - %154 = trunc i64 %153 to i1 - br i1 %154, label %cond_exit_515.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_515.thread.i.i - %155 = shl nuw i64 1, %152 - %156 = xor i64 %151, %155 - store i64 %156, ptr %150, align 4 - %157 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %148 - %158 = load i64, ptr %157, align 4 - tail call void @___dec_future_refcount(i64 %158) - br label %cond_exit_515.thread.1.i.i - -cond_exit_515.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_515.thread.i.i - %159 = add i64 %"512_1.sroa.10.0.i.i", 2 - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %cond_exit_515.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_515.thread.1.i.i - %166 = shl nuw i64 1, %163 - %167 = xor i64 %162, %166 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___dec_future_refcount(i64 %169) - br label %cond_exit_515.thread.2.i.i - -cond_exit_515.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_515.thread.1.i.i - %170 = add i64 %"512_1.sroa.10.0.i.i", 3 - %171 = lshr i64 %170, 6 - %172 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %171 - %173 = load i64, ptr %172, align 4 - %174 = and i64 %170, 63 - %175 = lshr i64 %173, %174 - %176 = trunc i64 %175 to i1 - br i1 %176, label %cond_exit_515.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_515.thread.2.i.i - %177 = shl nuw i64 1, %174 - %178 = xor i64 %173, %177 - store i64 %178, ptr %172, align 4 - %179 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %170 - %180 = load i64, ptr %179, align 4 - tail call void @___dec_future_refcount(i64 %180) - br label %cond_exit_515.thread.3.i.i - -cond_exit_515.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_515.thread.2.i.i - %181 = add i64 %"512_1.sroa.10.0.i.i", 4 - %182 = lshr i64 %181, 6 - %183 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %181, 63 - %186 = lshr i64 %184, %185 - %187 = trunc i64 %186 to i1 - br i1 %187, label %cond_exit_515.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_515.thread.3.i.i - %188 = shl nuw i64 1, %185 - %189 = xor i64 %184, %188 - store i64 %189, ptr %183, align 4 - %190 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %181 - %191 = load i64, ptr %190, align 4 - tail call void @___dec_future_refcount(i64 %191) - br label %cond_exit_515.thread.4.i.i - -cond_exit_515.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_515.thread.3.i.i - %192 = add i64 %"512_1.sroa.10.0.i.i", 5 - %193 = lshr i64 %192, 6 - %194 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %193 - %195 = load i64, ptr %194, align 4 - %196 = and i64 %192, 63 - %197 = lshr i64 %195, %196 - %198 = trunc i64 %197 to i1 - br i1 %198, label %cond_exit_515.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_515.thread.4.i.i - %199 = shl nuw i64 1, %196 - %200 = xor i64 %195, %199 - store i64 %200, ptr %194, align 4 - %201 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %192 - %202 = load i64, ptr %201, align 4 - tail call void @___dec_future_refcount(i64 %202) - br label %cond_exit_515.thread.5.i.i - -cond_exit_515.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_515.thread.4.i.i - %203 = add i64 %"512_1.sroa.10.0.i.i", 6 - %204 = lshr i64 %203, 6 - %205 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %204 - %206 = load i64, ptr %205, align 4 - %207 = and i64 %203, 63 - %208 = lshr i64 %206, %207 - %209 = trunc i64 %208 to i1 - br i1 %209, label %cond_exit_515.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_515.thread.5.i.i - %210 = shl nuw i64 1, %207 - %211 = xor i64 %206, %210 - store i64 %211, ptr %205, align 4 - %212 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %203 - %213 = load i64, ptr %212, align 4 - tail call void @___dec_future_refcount(i64 %213) - br label %cond_exit_515.thread.6.i.i - -cond_exit_515.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_515.thread.5.i.i - %214 = add i64 %"512_1.sroa.10.0.i.i", 7 - %215 = lshr i64 %214, 6 - %216 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %215 - %217 = load i64, ptr %216, align 4 - %218 = and i64 %214, 63 - %219 = lshr i64 %217, %218 - %220 = trunc i64 %219 to i1 - br i1 %220, label %cond_exit_515.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_515.thread.6.i.i - %221 = shl nuw i64 1, %218 - %222 = xor i64 %217, %221 - store i64 %222, ptr %216, align 4 - %223 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %214 - %224 = load i64, ptr %223, align 4 - tail call void @___dec_future_refcount(i64 %224) - br label %cond_exit_515.thread.7.i.i - -cond_exit_515.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_515.thread.6.i.i - %225 = add i64 %"512_1.sroa.10.0.i.i", 8 - %226 = lshr i64 %225, 6 - %227 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %226 - %228 = load i64, ptr %227, align 4 - %229 = and i64 %225, 63 - %230 = lshr i64 %228, %229 - %231 = trunc i64 %230 to i1 - br i1 %231, label %cond_exit_515.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_515.thread.7.i.i - %232 = shl nuw i64 1, %229 - %233 = xor i64 %228, %232 - store i64 %233, ptr %227, align 4 - %234 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %225 - %235 = load i64, ptr %234, align 4 - tail call void @___dec_future_refcount(i64 %235) - br label %cond_exit_515.thread.8.i.i - -cond_exit_515.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_515.thread.7.i.i - %236 = add i64 %"512_1.sroa.10.0.i.i", 9 - %237 = lshr i64 %236, 6 - %238 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %237 - %239 = load i64, ptr %238, align 4 - %240 = and i64 %236, 63 - %241 = lshr i64 %239, %240 - %242 = trunc i64 %241 to i1 - br i1 %242, label %cond_exit_515.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_515.thread.8.i.i - %243 = shl nuw i64 1, %240 - %244 = xor i64 %239, %243 - store i64 %244, ptr %238, align 4 - %245 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %236 - %246 = load i64, ptr %245, align 4 - tail call void @___dec_future_refcount(i64 %246) - br label %cond_exit_515.thread.9.i.i - -cond_exit_515.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_515.thread.8.i.i - %247 = load i64, ptr %119, align 4 - %248 = sub nuw nsw i64 64, %121 - %249 = lshr i64 -1, %248 - %250 = icmp eq i64 %121, 0 - %251 = select i1 %250, i64 0, i64 %249 - %252 = or i64 %247, %251 - store i64 %252, ptr %119, align 4 - %253 = load i64, ptr %238, align 4 - %254 = shl nsw i64 -2, %240 - %255 = icmp eq i64 %240, 63 - %256 = select i1 %255, i64 0, i64 %254 - %257 = or i64 %253, %256 - store i64 %257, ptr %238, align 4 - %reass.sub.i.i.i388 = sub nsw i64 %237, %118 - %.not.i.i.i389 = icmp eq i64 %reass.sub.i.i.i388, -1 - br i1 %.not.i.i.i389, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %258 = xor i64 %137, %133 - store i64 %258, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_488 + +cond_exit_488: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1206 = icmp eq i64 %113, 0 + br i1 %.not1206, label %__barray_mask_borrow.exit1167.1, label %cond_exit_488.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_488 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_488.1 + +cond_exit_488.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_488 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1207 = icmp eq i64 %118, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.2, label %cond_exit_488.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_488.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_488.2 + +cond_exit_488.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_488.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1208 = icmp eq i64 %123, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.3, label %cond_exit_488.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_488.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_488.3 + +cond_exit_488.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_488.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1209 = icmp eq i64 %128, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.4, label %cond_exit_488.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_488.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_488.4 + +cond_exit_488.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_488.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1210 = icmp eq i64 %133, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.5, label %cond_exit_488.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_488.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 tail call void @___dec_future_refcount(i64 %136) - %259 = load i64, ptr %117, align 4 - %260 = lshr i64 %259, %"229_0.sroa.15.0168.i" - %261 = trunc i64 %260 to i1 - br i1 %261, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %262 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %263 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %264 = xor i64 %259, %263 - store i64 %264, ptr %117, align 4 - %265 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %265, align 1 - %266 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %140, %cond_exit_515.thread.9.i.i - tail call void @heap_free(ptr %"512_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"512_1.sroa.5.0.i.i") - %267 = load i64, ptr %117, align 4 - %268 = and i64 %267, 1023 - store i64 %268, ptr %117, align 4 - %269 = icmp eq i64 %268, 0 - br i1 %269, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" + br label %cond_exit_488.5 + +cond_exit_488.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_488.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1211 = icmp eq i64 %138, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.6, label %cond_exit_488.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_488.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_488.6 + +cond_exit_488.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_488.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1212 = icmp eq i64 %143, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.7, label %cond_exit_488.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_488.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_488.7 + +cond_exit_488.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_488.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1213 = icmp eq i64 %148, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.8, label %cond_exit_488.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_488.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_488.8 + +cond_exit_488.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_488.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1214 = icmp eq i64 %153, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.9, label %cond_exit_488.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_488.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_488.9 + +cond_exit_488.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_488.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_488, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_488.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %270 = tail call ptr @heap_alloc(i64 10) - %271 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %271, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %270, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %270) - %272 = load i64, ptr %117, align 4 - %273 = and i64 %272, 1023 - store i64 %273, ptr %117, align 4 - %274 = icmp eq i64 %273, 0 - br i1 %274, label %__barray_check_none_borrowed.exit400, label %mask_block_err.i399 - -mask_block_err.i399: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %275 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %275, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %275, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -730,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-apple-darwin.ll index 14f1c1ee..ffbfb432 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-apple-darwin.ll @@ -3,567 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_492_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_442_case_0.i, label %__barray_check_bounds.exit -cond_492_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_442_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_492_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_442_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_492_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_442_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not418 = icmp eq i64 %10, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1199 = icmp eq i64 %14, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_492_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_442_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not419 = icmp eq i64 %14, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1200 = icmp eq i64 %18, 0 + br i1 %.not1200, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_492_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_442_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not420 = icmp eq i64 %18, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1201 = icmp eq i64 %22, 0 + br i1 %.not1201, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_492_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_442_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not421 = icmp eq i64 %22, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1202 = icmp eq i64 %26, 0 + br i1 %.not1202, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_492_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_442_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not422 = icmp eq i64 %26, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1203 = icmp eq i64 %30, 0 + br i1 %.not1203, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_492_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_442_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not423 = icmp eq i64 %30, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1204 = icmp eq i64 %34, 0 + br i1 %.not1204, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_492_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_442_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not424 = icmp eq i64 %34, 0 - br i1 %.not424, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1205 = icmp eq i64 %38, 0 + br i1 %.not1205, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_492_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_442_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not425 = icmp eq i64 %38, 0 - br i1 %.not425, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1206 = icmp eq i64 %42, 0 + br i1 %.not1206, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0416" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0416", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0416" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0416" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0416" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0416" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rxy(i64 %61, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %55, i64 %61, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %61, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %61, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0416" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rxy(i64 %65, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %59, i64 %65, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %65, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %65, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond417.not = icmp eq i64 %48, 9 - br i1 %exitcond417.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond1192 = icmp eq i64 %74, 10 + br i1 %exitcond1192, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01196" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"512_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 2 - %"512_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 1 - %"512_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %118 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %175, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %119, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %171, %loop_body.i386 ] - %119 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %118, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %118, 1 - %120 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %121 = lshr i64 %120, 6 - %122 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %120, 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %panic.i.i.i399, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i399: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01197" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01196" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01197", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01197" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %118, 0 - %127 = shl nuw i64 1, %124 - %128 = xor i64 %127, %123 - store i64 %128, ptr %122, align 4 - %129 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %120 - %130 = load i64, ptr %129, align 4 - tail call void @___inc_future_refcount(i64 %130) - %131 = load i64, ptr %122, align 4 - %132 = lshr i64 %131, %124 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01197" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01197" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01196", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01196", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01196" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01196" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01197", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_515_case_0.i.i: ; preds = %cond_exit_515.thread.i.i - %134 = lshr i64 %"512_1.sroa.10.0.i.i", 6 - %135 = getelementptr i64, ptr %"512_1.sroa.5.0.i.i", i64 %134 - %136 = load i64, ptr %135, align 4 - %137 = and i64 %"512_1.sroa.10.0.i.i", 63 - %138 = sub nuw nsw i64 64, %137 - %139 = lshr i64 -1, %138 - %140 = icmp eq i64 %137, 0 - %141 = select i1 %140, i64 0, i64 %139 - %142 = or i64 %136, %141 - store i64 %142, ptr %135, align 4 - %last_valid.i.i.i388 = add i64 %"512_1.sroa.10.0.i.i", 9 - %143 = lshr i64 %last_valid.i.i.i388, 6 - %144 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %143 - %145 = load i64, ptr %144, align 4 - %146 = and i64 %last_valid.i.i.i388, 63 - %147 = shl nsw i64 -2, %146 - %148 = icmp eq i64 %146, 63 - %149 = select i1 %148, i64 0, i64 %147 - %150 = or i64 %145, %149 - store i64 %150, ptr %144, align 4 - %reass.sub.i.i.i389 = sub nsw i64 %143, %134 - %.not.i.i.i390 = icmp eq i64 %reass.sub.i.i.i389, -1 - br i1 %.not.i.i.i390, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -151: ; preds = %mask_block_ok.i.i.i391 - %152 = add nuw i64 %.02.i.i.i392, 1 - %exitcond.not.i.i.i395 = icmp eq i64 %.02.i.i.i392, %reass.sub.i.i.i389 - br i1 %exitcond.not.i.i.i395, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -mask_block_ok.i.i.i391: ; preds = %cond_515_case_0.i.i, %151 - %.02.i.i.i392 = phi i64 [ %152, %151 ], [ 0, %cond_515_case_0.i.i ] - %gep.i.i.i393 = getelementptr i64, ptr %135, i64 %.02.i.i.i392 - %153 = load i64, ptr %gep.i.i.i393, align 4 - %154 = icmp eq i64 %153, -1 - br i1 %154, label %151, label %mask_block_err.i.i.i394 - -mask_block_err.i.i.i394: ; preds = %mask_block_ok.i.i.i391 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_515.thread.i.i, %loop_body.preheader.i.i - %"512_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %155, %cond_exit_515.thread.i.i ] - %155 = add nuw nsw i64 %"512_0.0239.i.i", 1 - %156 = add i64 %"512_0.0239.i.i", %"512_1.sroa.10.0.i.i" - %157 = lshr i64 %156, 6 - %158 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %157 - %159 = load i64, ptr %158, align 4 - %160 = and i64 %156, 63 - %161 = lshr i64 %159, %160 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_515.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %163 = shl nuw i64 1, %160 - %164 = xor i64 %163, %159 - store i64 %164, ptr %158, align 4 - %165 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %156 - %166 = load i64, ptr %165, align 4 - tail call void @___dec_future_refcount(i64 %166) - br label %cond_exit_515.thread.i.i - -cond_exit_515.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %155, 10 - br i1 %exitcond.i.i, label %cond_515_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %167 = xor i64 %131, %127 - store i64 %167, ptr %122, align 4 - store i64 %130, ptr %129, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %130) - tail call void @___dec_future_refcount(i64 %130) - %168 = load i64, ptr %117, align 4 - %169 = lshr i64 %168, %"229_0.sroa.15.0168.i" - %170 = trunc i64 %169 to i1 - br i1 %170, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 + +panic.i1154: ; preds = %__barray_check_bounds.exit1153 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %171 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %119, 1 - %172 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %173 = xor i64 %168, %172 - store i64 %173, ptr %117, align 4 - %174 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %174, align 1 - %175 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %119, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %151, %cond_515_case_0.i.i - tail call void @heap_free(ptr %"512_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"512_1.sroa.5.0.i.i") - %176 = load i64, ptr %117, align 4 - %177 = and i64 %176, 1023 - store i64 %177, ptr %117, align 4 - %178 = icmp eq i64 %177, 0 - br i1 %178, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" +mask_block_err.i1159: ; preds = %cond_exit_488.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_488 + +cond_exit_488: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1207 = icmp eq i64 %113, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.1, label %cond_exit_488.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_488 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_488.1 + +cond_exit_488.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_488 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1208 = icmp eq i64 %118, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.2, label %cond_exit_488.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_488.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_488.2 + +cond_exit_488.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_488.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1209 = icmp eq i64 %123, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.3, label %cond_exit_488.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_488.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_488.3 + +cond_exit_488.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_488.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1210 = icmp eq i64 %128, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.4, label %cond_exit_488.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_488.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_488.4 + +cond_exit_488.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_488.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1211 = icmp eq i64 %133, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.5, label %cond_exit_488.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_488.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_488.5 + +cond_exit_488.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_488.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1212 = icmp eq i64 %138, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.6, label %cond_exit_488.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_488.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_488.6 + +cond_exit_488.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_488.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1213 = icmp eq i64 %143, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.7, label %cond_exit_488.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_488.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_488.7 + +cond_exit_488.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_488.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1214 = icmp eq i64 %148, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.8, label %cond_exit_488.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_488.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_488.8 + +cond_exit_488.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_488.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1215 = icmp eq i64 %153, 0 + br i1 %.not1215, label %__barray_mask_borrow.exit1167.9, label %cond_exit_488.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_488.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_488.9 + +cond_exit_488.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_488.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_488, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_488.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %179 = tail call ptr @heap_alloc(i64 10) - %180 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %180, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %179, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %179) - %181 = load i64, ptr %117, align 4 - %182 = and i64 %181, 1023 - store i64 %182, ptr %117, align 4 - %183 = icmp eq i64 %182, 0 - br i1 %183, label %__barray_check_none_borrowed.exit401, label %mask_block_err.i400 - -mask_block_err.i400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit401: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %184 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %184, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %184, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -576,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-unknown-linux-gnu.ll index 423eb70e..ee5498f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-unknown-linux-gnu.ll @@ -3,567 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_492_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_442_case_0.i, label %__barray_check_bounds.exit -cond_492_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_442_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_492_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_442_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_492_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_442_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not418 = icmp eq i64 %10, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1199 = icmp eq i64 %14, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_492_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_442_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not419 = icmp eq i64 %14, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1200 = icmp eq i64 %18, 0 + br i1 %.not1200, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_492_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_442_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not420 = icmp eq i64 %18, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1201 = icmp eq i64 %22, 0 + br i1 %.not1201, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_492_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_442_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not421 = icmp eq i64 %22, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1202 = icmp eq i64 %26, 0 + br i1 %.not1202, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_492_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_442_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not422 = icmp eq i64 %26, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1203 = icmp eq i64 %30, 0 + br i1 %.not1203, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_492_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_442_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not423 = icmp eq i64 %30, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1204 = icmp eq i64 %34, 0 + br i1 %.not1204, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_492_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_442_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not424 = icmp eq i64 %34, 0 - br i1 %.not424, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1205 = icmp eq i64 %38, 0 + br i1 %.not1205, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_492_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_442_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not425 = icmp eq i64 %38, 0 - br i1 %.not425, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1206 = icmp eq i64 %42, 0 + br i1 %.not1206, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0416" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0416", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0416" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0416" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0416" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0416" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rxy(i64 %61, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %55, i64 %61, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %61, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %61, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0416" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rxy(i64 %65, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %59, i64 %65, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %65, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %65, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond417.not = icmp eq i64 %48, 9 - br i1 %exitcond417.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond1192 = icmp eq i64 %74, 10 + br i1 %exitcond1192, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01196" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"512_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 2 - %"512_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 1 - %"512_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %118 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %175, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %119, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %171, %loop_body.i386 ] - %119 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %118, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %118, 1 - %120 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %121 = lshr i64 %120, 6 - %122 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %120, 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %panic.i.i.i399, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i399: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01197" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01196" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01197", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01197" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %118, 0 - %127 = shl nuw i64 1, %124 - %128 = xor i64 %127, %123 - store i64 %128, ptr %122, align 4 - %129 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %120 - %130 = load i64, ptr %129, align 4 - tail call void @___inc_future_refcount(i64 %130) - %131 = load i64, ptr %122, align 4 - %132 = lshr i64 %131, %124 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01197" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01197" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01196", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01196", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01196" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01196" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01197", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_515_case_0.i.i: ; preds = %cond_exit_515.thread.i.i - %134 = lshr i64 %"512_1.sroa.10.0.i.i", 6 - %135 = getelementptr i64, ptr %"512_1.sroa.5.0.i.i", i64 %134 - %136 = load i64, ptr %135, align 4 - %137 = and i64 %"512_1.sroa.10.0.i.i", 63 - %138 = sub nuw nsw i64 64, %137 - %139 = lshr i64 -1, %138 - %140 = icmp eq i64 %137, 0 - %141 = select i1 %140, i64 0, i64 %139 - %142 = or i64 %136, %141 - store i64 %142, ptr %135, align 4 - %last_valid.i.i.i388 = add i64 %"512_1.sroa.10.0.i.i", 9 - %143 = lshr i64 %last_valid.i.i.i388, 6 - %144 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %143 - %145 = load i64, ptr %144, align 4 - %146 = and i64 %last_valid.i.i.i388, 63 - %147 = shl nsw i64 -2, %146 - %148 = icmp eq i64 %146, 63 - %149 = select i1 %148, i64 0, i64 %147 - %150 = or i64 %145, %149 - store i64 %150, ptr %144, align 4 - %reass.sub.i.i.i389 = sub nsw i64 %143, %134 - %.not.i.i.i390 = icmp eq i64 %reass.sub.i.i.i389, -1 - br i1 %.not.i.i.i390, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -151: ; preds = %mask_block_ok.i.i.i391 - %152 = add nuw i64 %.02.i.i.i392, 1 - %exitcond.not.i.i.i395 = icmp eq i64 %.02.i.i.i392, %reass.sub.i.i.i389 - br i1 %exitcond.not.i.i.i395, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -mask_block_ok.i.i.i391: ; preds = %cond_515_case_0.i.i, %151 - %.02.i.i.i392 = phi i64 [ %152, %151 ], [ 0, %cond_515_case_0.i.i ] - %gep.i.i.i393 = getelementptr i64, ptr %135, i64 %.02.i.i.i392 - %153 = load i64, ptr %gep.i.i.i393, align 4 - %154 = icmp eq i64 %153, -1 - br i1 %154, label %151, label %mask_block_err.i.i.i394 - -mask_block_err.i.i.i394: ; preds = %mask_block_ok.i.i.i391 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_515.thread.i.i, %loop_body.preheader.i.i - %"512_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %155, %cond_exit_515.thread.i.i ] - %155 = add nuw nsw i64 %"512_0.0239.i.i", 1 - %156 = add i64 %"512_0.0239.i.i", %"512_1.sroa.10.0.i.i" - %157 = lshr i64 %156, 6 - %158 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %157 - %159 = load i64, ptr %158, align 4 - %160 = and i64 %156, 63 - %161 = lshr i64 %159, %160 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_515.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %163 = shl nuw i64 1, %160 - %164 = xor i64 %163, %159 - store i64 %164, ptr %158, align 4 - %165 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %156 - %166 = load i64, ptr %165, align 4 - tail call void @___dec_future_refcount(i64 %166) - br label %cond_exit_515.thread.i.i - -cond_exit_515.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %155, 10 - br i1 %exitcond.i.i, label %cond_515_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %167 = xor i64 %131, %127 - store i64 %167, ptr %122, align 4 - store i64 %130, ptr %129, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %130) - tail call void @___dec_future_refcount(i64 %130) - %168 = load i64, ptr %117, align 4 - %169 = lshr i64 %168, %"229_0.sroa.15.0168.i" - %170 = trunc i64 %169 to i1 - br i1 %170, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 + +panic.i1154: ; preds = %__barray_check_bounds.exit1153 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %171 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %119, 1 - %172 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %173 = xor i64 %168, %172 - store i64 %173, ptr %117, align 4 - %174 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %174, align 1 - %175 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %119, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %151, %cond_515_case_0.i.i - tail call void @heap_free(ptr %"512_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"512_1.sroa.5.0.i.i") - %176 = load i64, ptr %117, align 4 - %177 = and i64 %176, 1023 - store i64 %177, ptr %117, align 4 - %178 = icmp eq i64 %177, 0 - br i1 %178, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" +mask_block_err.i1159: ; preds = %cond_exit_488.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_488 + +cond_exit_488: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1207 = icmp eq i64 %113, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.1, label %cond_exit_488.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_488 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_488.1 + +cond_exit_488.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_488 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1208 = icmp eq i64 %118, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.2, label %cond_exit_488.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_488.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_488.2 + +cond_exit_488.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_488.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1209 = icmp eq i64 %123, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.3, label %cond_exit_488.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_488.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_488.3 + +cond_exit_488.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_488.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1210 = icmp eq i64 %128, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.4, label %cond_exit_488.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_488.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_488.4 + +cond_exit_488.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_488.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1211 = icmp eq i64 %133, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.5, label %cond_exit_488.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_488.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_488.5 + +cond_exit_488.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_488.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1212 = icmp eq i64 %138, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.6, label %cond_exit_488.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_488.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_488.6 + +cond_exit_488.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_488.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1213 = icmp eq i64 %143, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.7, label %cond_exit_488.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_488.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_488.7 + +cond_exit_488.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_488.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1214 = icmp eq i64 %148, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.8, label %cond_exit_488.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_488.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_488.8 + +cond_exit_488.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_488.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1215 = icmp eq i64 %153, 0 + br i1 %.not1215, label %__barray_mask_borrow.exit1167.9, label %cond_exit_488.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_488.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_488.9 + +cond_exit_488.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_488.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_488, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_488.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %179 = tail call ptr @heap_alloc(i64 10) - %180 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %180, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %179, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %179) - %181 = load i64, ptr %117, align 4 - %182 = and i64 %181, 1023 - store i64 %182, ptr %117, align 4 - %183 = icmp eq i64 %182, 0 - br i1 %183, label %__barray_check_none_borrowed.exit401, label %mask_block_err.i400 - -mask_block_err.i400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit401: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %184 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %184, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %184, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -576,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-windows-gnu.ll index 71f57d74..ca6a39f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-helios-x86_64-windows-gnu.ll @@ -3,567 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_492_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_442_case_0.i, label %__barray_check_bounds.exit -cond_492_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_442_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_492_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_442_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_492_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_442_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not418 = icmp eq i64 %10, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1199 = icmp eq i64 %14, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_492_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_442_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not419 = icmp eq i64 %14, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1200 = icmp eq i64 %18, 0 + br i1 %.not1200, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_492_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_442_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not420 = icmp eq i64 %18, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1201 = icmp eq i64 %22, 0 + br i1 %.not1201, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_492_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_442_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not421 = icmp eq i64 %22, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1202 = icmp eq i64 %26, 0 + br i1 %.not1202, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_492_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_442_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not422 = icmp eq i64 %26, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1203 = icmp eq i64 %30, 0 + br i1 %.not1203, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_492_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_442_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not423 = icmp eq i64 %30, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1204 = icmp eq i64 %34, 0 + br i1 %.not1204, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_492_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_442_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not424 = icmp eq i64 %34, 0 - br i1 %.not424, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1205 = icmp eq i64 %38, 0 + br i1 %.not1205, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_492_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_442_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not425 = icmp eq i64 %38, 0 - br i1 %.not425, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1206 = icmp eq i64 %42, 0 + br i1 %.not1206, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rxy(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rxy(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0416" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0416", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0416" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0416" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0416" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0416" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rxy(i64 %61, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rzz(i64 %55, i64 %61, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - tail call void @___rxy(i64 %61, double 0x3FF921FB54442D18, double 0x400921FB54442D18) - tail call void @___rz(i64 %61, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0416" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rxy(i64 %65, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rzz(i64 %59, i64 %65, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + tail call void @___rxy(i64 %65, double 0x3FF921FB54442D18, double 0x400921FB54442D18) + tail call void @___rz(i64 %65, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond417.not = icmp eq i64 %48, 9 - br i1 %exitcond417.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond1192 = icmp eq i64 %74, 10 + br i1 %exitcond1192, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01196" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"512_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 2 - %"512_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 1 - %"512_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %118 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %175, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %119, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %171, %loop_body.i386 ] - %119 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %118, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %118, 1 - %120 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %121 = lshr i64 %120, 6 - %122 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %120, 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %panic.i.i.i399, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i399: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01197" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01196" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01197", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01197" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %118, 0 - %127 = shl nuw i64 1, %124 - %128 = xor i64 %127, %123 - store i64 %128, ptr %122, align 4 - %129 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %120 - %130 = load i64, ptr %129, align 4 - tail call void @___inc_future_refcount(i64 %130) - %131 = load i64, ptr %122, align 4 - %132 = lshr i64 %131, %124 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01197" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01197" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01196", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01196", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01196" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01196" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01197", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_515_case_0.i.i: ; preds = %cond_exit_515.thread.i.i - %134 = lshr i64 %"512_1.sroa.10.0.i.i", 6 - %135 = getelementptr i64, ptr %"512_1.sroa.5.0.i.i", i64 %134 - %136 = load i64, ptr %135, align 4 - %137 = and i64 %"512_1.sroa.10.0.i.i", 63 - %138 = sub nuw nsw i64 64, %137 - %139 = lshr i64 -1, %138 - %140 = icmp eq i64 %137, 0 - %141 = select i1 %140, i64 0, i64 %139 - %142 = or i64 %136, %141 - store i64 %142, ptr %135, align 4 - %last_valid.i.i.i388 = add i64 %"512_1.sroa.10.0.i.i", 9 - %143 = lshr i64 %last_valid.i.i.i388, 6 - %144 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %143 - %145 = load i64, ptr %144, align 4 - %146 = and i64 %last_valid.i.i.i388, 63 - %147 = shl nsw i64 -2, %146 - %148 = icmp eq i64 %146, 63 - %149 = select i1 %148, i64 0, i64 %147 - %150 = or i64 %145, %149 - store i64 %150, ptr %144, align 4 - %reass.sub.i.i.i389 = sub nsw i64 %143, %134 - %.not.i.i.i390 = icmp eq i64 %reass.sub.i.i.i389, -1 - br i1 %.not.i.i.i390, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -151: ; preds = %mask_block_ok.i.i.i391 - %152 = add nuw i64 %.02.i.i.i392, 1 - %exitcond.not.i.i.i395 = icmp eq i64 %.02.i.i.i392, %reass.sub.i.i.i389 - br i1 %exitcond.not.i.i.i395, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -mask_block_ok.i.i.i391: ; preds = %cond_515_case_0.i.i, %151 - %.02.i.i.i392 = phi i64 [ %152, %151 ], [ 0, %cond_515_case_0.i.i ] - %gep.i.i.i393 = getelementptr i64, ptr %135, i64 %.02.i.i.i392 - %153 = load i64, ptr %gep.i.i.i393, align 4 - %154 = icmp eq i64 %153, -1 - br i1 %154, label %151, label %mask_block_err.i.i.i394 - -mask_block_err.i.i.i394: ; preds = %mask_block_ok.i.i.i391 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_515.thread.i.i, %loop_body.preheader.i.i - %"512_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %155, %cond_exit_515.thread.i.i ] - %155 = add nuw nsw i64 %"512_0.0239.i.i", 1 - %156 = add i64 %"512_0.0239.i.i", %"512_1.sroa.10.0.i.i" - %157 = lshr i64 %156, 6 - %158 = getelementptr inbounds nuw i64, ptr %"512_1.sroa.5.0.i.i", i64 %157 - %159 = load i64, ptr %158, align 4 - %160 = and i64 %156, 63 - %161 = lshr i64 %159, %160 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_515.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %163 = shl nuw i64 1, %160 - %164 = xor i64 %163, %159 - store i64 %164, ptr %158, align 4 - %165 = getelementptr inbounds i64, ptr %"512_1.sroa.0.0.i.i", i64 %156 - %166 = load i64, ptr %165, align 4 - tail call void @___dec_future_refcount(i64 %166) - br label %cond_exit_515.thread.i.i - -cond_exit_515.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %155, 10 - br i1 %exitcond.i.i, label %cond_515_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %167 = xor i64 %131, %127 - store i64 %167, ptr %122, align 4 - store i64 %130, ptr %129, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %130) - tail call void @___dec_future_refcount(i64 %130) - %168 = load i64, ptr %117, align 4 - %169 = lshr i64 %168, %"229_0.sroa.15.0168.i" - %170 = trunc i64 %169 to i1 - br i1 %170, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 + +panic.i1154: ; preds = %__barray_check_bounds.exit1153 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %171 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %119, 1 - %172 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %173 = xor i64 %168, %172 - store i64 %173, ptr %117, align 4 - %174 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %174, align 1 - %175 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %119, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %151, %cond_515_case_0.i.i - tail call void @heap_free(ptr %"512_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"512_1.sroa.5.0.i.i") - %176 = load i64, ptr %117, align 4 - %177 = and i64 %176, 1023 - store i64 %177, ptr %117, align 4 - %178 = icmp eq i64 %177, 0 - br i1 %178, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" +mask_block_err.i1159: ; preds = %cond_exit_488.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_488 + +cond_exit_488: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1207 = icmp eq i64 %113, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.1, label %cond_exit_488.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_488 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_488.1 + +cond_exit_488.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_488 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1208 = icmp eq i64 %118, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.2, label %cond_exit_488.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_488.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_488.2 + +cond_exit_488.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_488.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1209 = icmp eq i64 %123, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.3, label %cond_exit_488.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_488.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_488.3 + +cond_exit_488.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_488.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1210 = icmp eq i64 %128, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.4, label %cond_exit_488.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_488.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_488.4 + +cond_exit_488.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_488.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1211 = icmp eq i64 %133, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.5, label %cond_exit_488.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_488.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_488.5 + +cond_exit_488.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_488.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1212 = icmp eq i64 %138, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.6, label %cond_exit_488.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_488.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_488.6 + +cond_exit_488.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_488.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1213 = icmp eq i64 %143, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.7, label %cond_exit_488.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_488.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_488.7 + +cond_exit_488.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_488.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1214 = icmp eq i64 %148, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.8, label %cond_exit_488.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_488.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_488.8 + +cond_exit_488.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_488.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1215 = icmp eq i64 %153, 0 + br i1 %.not1215, label %__barray_mask_borrow.exit1167.9, label %cond_exit_488.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_488.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_488.9 + +cond_exit_488.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_488.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_488, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_488.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %179 = tail call ptr @heap_alloc(i64 10) - %180 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %180, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %179, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %179) - %181 = load i64, ptr %117, align 4 - %182 = and i64 %181, 1023 - store i64 %182, ptr %117, align 4 - %183 = icmp eq i64 %182, 0 - br i1 %183, label %__barray_check_none_borrowed.exit401, label %mask_block_err.i400 - -mask_block_err.i400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit401: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %184 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %184, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %184, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -576,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-apple-darwin.ll index 7ad0dbd2..50ba00d9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-apple-darwin.ll @@ -3,721 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit + br i1 %not_max.not.not.i, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit -cond_491_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_441_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.464.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.437.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.464.exit.8, %__hugr__.__tk2_sol_qalloc.464.exit.7, %__hugr__.__tk2_sol_qalloc.464.exit.6, %__hugr__.__tk2_sol_qalloc.464.exit.5, %__hugr__.__tk2_sol_qalloc.464.exit.4, %__hugr__.__tk2_sol_qalloc.464.exit.3, %__hugr__.__tk2_sol_qalloc.464.exit.2, %__hugr__.__tk2_sol_qalloc.464.exit.1, %__hugr__.__tk2_sol_qalloc.464.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.437.exit.8, %__hugr__.__tk2_sol_qalloc.437.exit.7, %__hugr__.__tk2_sol_qalloc.437.exit.6, %__hugr__.__tk2_sol_qalloc.437.exit.5, %__hugr__.__tk2_sol_qalloc.437.exit.4, %__hugr__.__tk2_sol_qalloc.437.exit.3, %__hugr__.__tk2_sol_qalloc.437.exit.2, %__hugr__.__tk2_sol_qalloc.437.exit.1, %__hugr__.__tk2_sol_qalloc.437.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.1 + br i1 %not_max.not.not.i.1, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.1 -__hugr__.__tk2_sol_qalloc.464.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.437.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.2 + br i1 %not_max.not.not.i.2, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.2 -__hugr__.__tk2_sol_qalloc.464.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.437.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not416 = icmp eq i64 %10, 0 - br i1 %.not416, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1192 = icmp eq i64 %14, 0 + br i1 %.not1192, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.3 + br i1 %not_max.not.not.i.3, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.3 -__hugr__.__tk2_sol_qalloc.464.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.437.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not417 = icmp eq i64 %14, 0 - br i1 %.not417, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1193 = icmp eq i64 %18, 0 + br i1 %.not1193, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.4 + br i1 %not_max.not.not.i.4, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.4 -__hugr__.__tk2_sol_qalloc.464.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.437.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not418 = icmp eq i64 %18, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1194 = icmp eq i64 %22, 0 + br i1 %.not1194, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.5 + br i1 %not_max.not.not.i.5, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.5 -__hugr__.__tk2_sol_qalloc.464.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.437.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not419 = icmp eq i64 %22, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1195 = icmp eq i64 %26, 0 + br i1 %.not1195, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.6 + br i1 %not_max.not.not.i.6, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.6 -__hugr__.__tk2_sol_qalloc.464.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.437.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not420 = icmp eq i64 %26, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1196 = icmp eq i64 %30, 0 + br i1 %.not1196, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.7 + br i1 %not_max.not.not.i.7, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.7 -__hugr__.__tk2_sol_qalloc.464.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.437.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not421 = icmp eq i64 %30, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1197 = icmp eq i64 %34, 0 + br i1 %.not1197, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.8 + br i1 %not_max.not.not.i.8, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.8 -__hugr__.__tk2_sol_qalloc.464.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.437.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not422 = icmp eq i64 %34, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1198 = icmp eq i64 %38, 0 + br i1 %.not1198, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_491_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_441_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not423 = icmp eq i64 %38, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1199 = icmp eq i64 %42, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0415" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0415", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0415" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0415" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0415" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0415" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rp(i64 %55, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %55, i64 %61, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %61, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %55, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0415" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rp(i64 %59, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %59, i64 %65, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %65, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %59, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond.not = icmp eq i64 %48, 9 - br i1 %exitcond.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond = icmp eq i64 %74, 10 + br i1 %exitcond, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01203" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"511_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 2 - %"511_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 1 - %"511_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 0 - %118 = lshr i64 %"511_1.sroa.10.0.i.i", 6 - %119 = getelementptr i64, ptr %"511_1.sroa.5.0.i.i", i64 %118 - %120 = load i64, ptr %119, align 4 - %121 = and i64 %"511_1.sroa.10.0.i.i", 63 - %122 = lshr i64 %120, %121 - %123 = trunc i64 %122 to i1 - br i1 %123, label %cond_exit_514.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %266, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %125, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %262, %loop_body.i386 ] - %125 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i398, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i398: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01204" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01203" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01204", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01204" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01204" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01204" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01203", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01203", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01203" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01203" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01204", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -140: ; preds = %mask_block_ok.i.i.i390 - %141 = add nuw i64 %.02.i.i.i391, 1 - %exitcond.not.i.i.i394 = icmp eq i64 %.02.i.i.i391, %reass.sub.i.i.i388 - br i1 %exitcond.not.i.i.i394, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 -mask_block_ok.i.i.i390: ; preds = %cond_exit_514.thread.9.i.i, %140 - %.02.i.i.i391 = phi i64 [ %141, %140 ], [ 0, %cond_exit_514.thread.9.i.i ] - %gep.i.i.i392 = getelementptr i64, ptr %119, i64 %.02.i.i.i391 - %142 = load i64, ptr %gep.i.i.i392, align 4 - %143 = icmp eq i64 %142, -1 - br i1 %143, label %140, label %mask_block_err.i.i.i393 +panic.i1154: ; preds = %__barray_check_bounds.exit1153 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i393: ; preds = %mask_block_ok.i.i.i390 +mask_block_err.i1159: ; preds = %cond_exit_487.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %144 = shl nuw i64 1, %121 - %145 = xor i64 %120, %144 - store i64 %145, ptr %119, align 4 - %146 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %"511_1.sroa.10.0.i.i" - %147 = load i64, ptr %146, align 4 - tail call void @___dec_future_refcount(i64 %147) - br label %cond_exit_514.thread.i.i - -cond_exit_514.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %148 = add i64 %"511_1.sroa.10.0.i.i", 1 - %149 = lshr i64 %148, 6 - %150 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %148, 63 - %153 = lshr i64 %151, %152 - %154 = trunc i64 %153 to i1 - br i1 %154, label %cond_exit_514.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_514.thread.i.i - %155 = shl nuw i64 1, %152 - %156 = xor i64 %151, %155 - store i64 %156, ptr %150, align 4 - %157 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %148 - %158 = load i64, ptr %157, align 4 - tail call void @___dec_future_refcount(i64 %158) - br label %cond_exit_514.thread.1.i.i - -cond_exit_514.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_514.thread.i.i - %159 = add i64 %"511_1.sroa.10.0.i.i", 2 - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %cond_exit_514.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_514.thread.1.i.i - %166 = shl nuw i64 1, %163 - %167 = xor i64 %162, %166 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___dec_future_refcount(i64 %169) - br label %cond_exit_514.thread.2.i.i - -cond_exit_514.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_514.thread.1.i.i - %170 = add i64 %"511_1.sroa.10.0.i.i", 3 - %171 = lshr i64 %170, 6 - %172 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %171 - %173 = load i64, ptr %172, align 4 - %174 = and i64 %170, 63 - %175 = lshr i64 %173, %174 - %176 = trunc i64 %175 to i1 - br i1 %176, label %cond_exit_514.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_514.thread.2.i.i - %177 = shl nuw i64 1, %174 - %178 = xor i64 %173, %177 - store i64 %178, ptr %172, align 4 - %179 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %170 - %180 = load i64, ptr %179, align 4 - tail call void @___dec_future_refcount(i64 %180) - br label %cond_exit_514.thread.3.i.i - -cond_exit_514.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_514.thread.2.i.i - %181 = add i64 %"511_1.sroa.10.0.i.i", 4 - %182 = lshr i64 %181, 6 - %183 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %181, 63 - %186 = lshr i64 %184, %185 - %187 = trunc i64 %186 to i1 - br i1 %187, label %cond_exit_514.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_514.thread.3.i.i - %188 = shl nuw i64 1, %185 - %189 = xor i64 %184, %188 - store i64 %189, ptr %183, align 4 - %190 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %181 - %191 = load i64, ptr %190, align 4 - tail call void @___dec_future_refcount(i64 %191) - br label %cond_exit_514.thread.4.i.i - -cond_exit_514.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_514.thread.3.i.i - %192 = add i64 %"511_1.sroa.10.0.i.i", 5 - %193 = lshr i64 %192, 6 - %194 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %193 - %195 = load i64, ptr %194, align 4 - %196 = and i64 %192, 63 - %197 = lshr i64 %195, %196 - %198 = trunc i64 %197 to i1 - br i1 %198, label %cond_exit_514.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_514.thread.4.i.i - %199 = shl nuw i64 1, %196 - %200 = xor i64 %195, %199 - store i64 %200, ptr %194, align 4 - %201 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %192 - %202 = load i64, ptr %201, align 4 - tail call void @___dec_future_refcount(i64 %202) - br label %cond_exit_514.thread.5.i.i - -cond_exit_514.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_514.thread.4.i.i - %203 = add i64 %"511_1.sroa.10.0.i.i", 6 - %204 = lshr i64 %203, 6 - %205 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %204 - %206 = load i64, ptr %205, align 4 - %207 = and i64 %203, 63 - %208 = lshr i64 %206, %207 - %209 = trunc i64 %208 to i1 - br i1 %209, label %cond_exit_514.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_514.thread.5.i.i - %210 = shl nuw i64 1, %207 - %211 = xor i64 %206, %210 - store i64 %211, ptr %205, align 4 - %212 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %203 - %213 = load i64, ptr %212, align 4 - tail call void @___dec_future_refcount(i64 %213) - br label %cond_exit_514.thread.6.i.i - -cond_exit_514.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_514.thread.5.i.i - %214 = add i64 %"511_1.sroa.10.0.i.i", 7 - %215 = lshr i64 %214, 6 - %216 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %215 - %217 = load i64, ptr %216, align 4 - %218 = and i64 %214, 63 - %219 = lshr i64 %217, %218 - %220 = trunc i64 %219 to i1 - br i1 %220, label %cond_exit_514.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_514.thread.6.i.i - %221 = shl nuw i64 1, %218 - %222 = xor i64 %217, %221 - store i64 %222, ptr %216, align 4 - %223 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %214 - %224 = load i64, ptr %223, align 4 - tail call void @___dec_future_refcount(i64 %224) - br label %cond_exit_514.thread.7.i.i - -cond_exit_514.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_514.thread.6.i.i - %225 = add i64 %"511_1.sroa.10.0.i.i", 8 - %226 = lshr i64 %225, 6 - %227 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %226 - %228 = load i64, ptr %227, align 4 - %229 = and i64 %225, 63 - %230 = lshr i64 %228, %229 - %231 = trunc i64 %230 to i1 - br i1 %231, label %cond_exit_514.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_514.thread.7.i.i - %232 = shl nuw i64 1, %229 - %233 = xor i64 %228, %232 - store i64 %233, ptr %227, align 4 - %234 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %225 - %235 = load i64, ptr %234, align 4 - tail call void @___dec_future_refcount(i64 %235) - br label %cond_exit_514.thread.8.i.i - -cond_exit_514.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_514.thread.7.i.i - %236 = add i64 %"511_1.sroa.10.0.i.i", 9 - %237 = lshr i64 %236, 6 - %238 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %237 - %239 = load i64, ptr %238, align 4 - %240 = and i64 %236, 63 - %241 = lshr i64 %239, %240 - %242 = trunc i64 %241 to i1 - br i1 %242, label %cond_exit_514.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_514.thread.8.i.i - %243 = shl nuw i64 1, %240 - %244 = xor i64 %239, %243 - store i64 %244, ptr %238, align 4 - %245 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %236 - %246 = load i64, ptr %245, align 4 - tail call void @___dec_future_refcount(i64 %246) - br label %cond_exit_514.thread.9.i.i - -cond_exit_514.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_514.thread.8.i.i - %247 = load i64, ptr %119, align 4 - %248 = sub nuw nsw i64 64, %121 - %249 = lshr i64 -1, %248 - %250 = icmp eq i64 %121, 0 - %251 = select i1 %250, i64 0, i64 %249 - %252 = or i64 %247, %251 - store i64 %252, ptr %119, align 4 - %253 = load i64, ptr %238, align 4 - %254 = shl nsw i64 -2, %240 - %255 = icmp eq i64 %240, 63 - %256 = select i1 %255, i64 0, i64 %254 - %257 = or i64 %253, %256 - store i64 %257, ptr %238, align 4 - %reass.sub.i.i.i388 = sub nsw i64 %237, %118 - %.not.i.i.i389 = icmp eq i64 %reass.sub.i.i.i388, -1 - br i1 %.not.i.i.i389, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %258 = xor i64 %137, %133 - store i64 %258, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_487 + +cond_exit_487: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1206 = icmp eq i64 %113, 0 + br i1 %.not1206, label %__barray_mask_borrow.exit1167.1, label %cond_exit_487.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_487 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_487.1 + +cond_exit_487.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_487 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1207 = icmp eq i64 %118, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.2, label %cond_exit_487.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_487.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_487.2 + +cond_exit_487.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_487.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1208 = icmp eq i64 %123, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.3, label %cond_exit_487.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_487.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_487.3 + +cond_exit_487.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_487.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1209 = icmp eq i64 %128, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.4, label %cond_exit_487.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_487.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_487.4 + +cond_exit_487.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_487.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1210 = icmp eq i64 %133, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.5, label %cond_exit_487.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_487.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 tail call void @___dec_future_refcount(i64 %136) - %259 = load i64, ptr %117, align 4 - %260 = lshr i64 %259, %"229_0.sroa.15.0168.i" - %261 = trunc i64 %260 to i1 - br i1 %261, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %262 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %263 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %264 = xor i64 %259, %263 - store i64 %264, ptr %117, align 4 - %265 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %265, align 1 - %266 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %140, %cond_exit_514.thread.9.i.i - tail call void @heap_free(ptr %"511_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"511_1.sroa.5.0.i.i") - %267 = load i64, ptr %117, align 4 - %268 = and i64 %267, 1023 - store i64 %268, ptr %117, align 4 - %269 = icmp eq i64 %268, 0 - br i1 %269, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" + br label %cond_exit_487.5 + +cond_exit_487.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_487.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1211 = icmp eq i64 %138, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.6, label %cond_exit_487.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_487.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_487.6 + +cond_exit_487.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_487.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1212 = icmp eq i64 %143, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.7, label %cond_exit_487.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_487.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_487.7 + +cond_exit_487.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_487.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1213 = icmp eq i64 %148, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.8, label %cond_exit_487.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_487.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_487.8 + +cond_exit_487.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_487.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1214 = icmp eq i64 %153, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.9, label %cond_exit_487.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_487.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_487.9 + +cond_exit_487.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_487.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_487, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_487.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %270 = tail call ptr @heap_alloc(i64 10) - %271 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %271, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %270, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %270) - %272 = load i64, ptr %117, align 4 - %273 = and i64 %272, 1023 - store i64 %273, ptr %117, align 4 - %274 = icmp eq i64 %273, 0 - br i1 %274, label %__barray_check_none_borrowed.exit400, label %mask_block_err.i399 - -mask_block_err.i399: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %275 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %275, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %275, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -730,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-unknown-linux-gnu.ll index c26ea7bb..d206b654 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-aarch64-unknown-linux-gnu.ll @@ -3,721 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit + br i1 %not_max.not.not.i, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit -cond_491_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_441_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.464.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.437.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.464.exit.8, %__hugr__.__tk2_sol_qalloc.464.exit.7, %__hugr__.__tk2_sol_qalloc.464.exit.6, %__hugr__.__tk2_sol_qalloc.464.exit.5, %__hugr__.__tk2_sol_qalloc.464.exit.4, %__hugr__.__tk2_sol_qalloc.464.exit.3, %__hugr__.__tk2_sol_qalloc.464.exit.2, %__hugr__.__tk2_sol_qalloc.464.exit.1, %__hugr__.__tk2_sol_qalloc.464.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.437.exit.8, %__hugr__.__tk2_sol_qalloc.437.exit.7, %__hugr__.__tk2_sol_qalloc.437.exit.6, %__hugr__.__tk2_sol_qalloc.437.exit.5, %__hugr__.__tk2_sol_qalloc.437.exit.4, %__hugr__.__tk2_sol_qalloc.437.exit.3, %__hugr__.__tk2_sol_qalloc.437.exit.2, %__hugr__.__tk2_sol_qalloc.437.exit.1, %__hugr__.__tk2_sol_qalloc.437.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.1 + br i1 %not_max.not.not.i.1, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.1 -__hugr__.__tk2_sol_qalloc.464.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.437.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.2 + br i1 %not_max.not.not.i.2, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.2 -__hugr__.__tk2_sol_qalloc.464.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.437.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not416 = icmp eq i64 %10, 0 - br i1 %.not416, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1192 = icmp eq i64 %14, 0 + br i1 %.not1192, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.3 + br i1 %not_max.not.not.i.3, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.3 -__hugr__.__tk2_sol_qalloc.464.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.437.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not417 = icmp eq i64 %14, 0 - br i1 %.not417, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1193 = icmp eq i64 %18, 0 + br i1 %.not1193, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.4 + br i1 %not_max.not.not.i.4, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.4 -__hugr__.__tk2_sol_qalloc.464.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.437.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not418 = icmp eq i64 %18, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1194 = icmp eq i64 %22, 0 + br i1 %.not1194, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.5 + br i1 %not_max.not.not.i.5, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.5 -__hugr__.__tk2_sol_qalloc.464.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.437.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not419 = icmp eq i64 %22, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1195 = icmp eq i64 %26, 0 + br i1 %.not1195, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.6 + br i1 %not_max.not.not.i.6, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.6 -__hugr__.__tk2_sol_qalloc.464.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.437.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not420 = icmp eq i64 %26, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1196 = icmp eq i64 %30, 0 + br i1 %.not1196, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.7 + br i1 %not_max.not.not.i.7, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.7 -__hugr__.__tk2_sol_qalloc.464.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.437.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not421 = icmp eq i64 %30, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1197 = icmp eq i64 %34, 0 + br i1 %.not1197, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_491_case_0.i, label %__hugr__.__tk2_sol_qalloc.464.exit.8 + br i1 %not_max.not.not.i.8, label %cond_441_case_0.i, label %__hugr__.__tk2_sol_qalloc.437.exit.8 -__hugr__.__tk2_sol_qalloc.464.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.437.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not422 = icmp eq i64 %34, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.464.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1198 = icmp eq i64 %38, 0 + br i1 %.not1198, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__hugr__.__tk2_sol_qalloc.437.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_491_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_441_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not423 = icmp eq i64 %38, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1199 = icmp eq i64 %42, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0415" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0415", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0415" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0415" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0415" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0415" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rp(i64 %55, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %55, i64 %61, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %61, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %55, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0415" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rp(i64 %59, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %59, i64 %65, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %65, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %59, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond.not = icmp eq i64 %48, 9 - br i1 %exitcond.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond = icmp eq i64 %74, 10 + br i1 %exitcond, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01203" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"511_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 2 - %"511_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 1 - %"511_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %266, 0 - %118 = lshr i64 %"511_1.sroa.10.0.i.i", 6 - %119 = getelementptr i64, ptr %"511_1.sroa.5.0.i.i", i64 %118 - %120 = load i64, ptr %119, align 4 - %121 = and i64 %"511_1.sroa.10.0.i.i", 63 - %122 = lshr i64 %120, %121 - %123 = trunc i64 %122 to i1 - br i1 %123, label %cond_exit_514.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %124 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %266, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %125, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %262, %loop_body.i386 ] - %125 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %124, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %124, 1 - %126 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %127 = lshr i64 %126, 6 - %128 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %127 - %129 = load i64, ptr %128, align 4 - %130 = and i64 %126, 63 - %131 = lshr i64 %129, %130 - %132 = trunc i64 %131 to i1 - br i1 %132, label %panic.i.i.i398, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i398: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01204" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01203" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01204", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01204" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %124, 0 - %133 = shl nuw i64 1, %130 - %134 = xor i64 %133, %129 - store i64 %134, ptr %128, align 4 - %135 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %126 - %136 = load i64, ptr %135, align 4 - tail call void @___inc_future_refcount(i64 %136) - %137 = load i64, ptr %128, align 4 - %138 = lshr i64 %137, %130 - %139 = trunc i64 %138 to i1 - br i1 %139, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01204" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01204" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01203", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01203", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01203" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01203" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01204", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -140: ; preds = %mask_block_ok.i.i.i390 - %141 = add nuw i64 %.02.i.i.i391, 1 - %exitcond.not.i.i.i394 = icmp eq i64 %.02.i.i.i391, %reass.sub.i.i.i388 - br i1 %exitcond.not.i.i.i394, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 -mask_block_ok.i.i.i390: ; preds = %cond_exit_514.thread.9.i.i, %140 - %.02.i.i.i391 = phi i64 [ %141, %140 ], [ 0, %cond_exit_514.thread.9.i.i ] - %gep.i.i.i392 = getelementptr i64, ptr %119, i64 %.02.i.i.i391 - %142 = load i64, ptr %gep.i.i.i392, align 4 - %143 = icmp eq i64 %142, -1 - br i1 %143, label %140, label %mask_block_err.i.i.i393 +panic.i1154: ; preds = %__barray_check_bounds.exit1153 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable -mask_block_err.i.i.i393: ; preds = %mask_block_ok.i.i.i390 +mask_block_err.i1159: ; preds = %cond_exit_487.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %144 = shl nuw i64 1, %121 - %145 = xor i64 %120, %144 - store i64 %145, ptr %119, align 4 - %146 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %"511_1.sroa.10.0.i.i" - %147 = load i64, ptr %146, align 4 - tail call void @___dec_future_refcount(i64 %147) - br label %cond_exit_514.thread.i.i - -cond_exit_514.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %148 = add i64 %"511_1.sroa.10.0.i.i", 1 - %149 = lshr i64 %148, 6 - %150 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %149 - %151 = load i64, ptr %150, align 4 - %152 = and i64 %148, 63 - %153 = lshr i64 %151, %152 - %154 = trunc i64 %153 to i1 - br i1 %154, label %cond_exit_514.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_514.thread.i.i - %155 = shl nuw i64 1, %152 - %156 = xor i64 %151, %155 - store i64 %156, ptr %150, align 4 - %157 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %148 - %158 = load i64, ptr %157, align 4 - tail call void @___dec_future_refcount(i64 %158) - br label %cond_exit_514.thread.1.i.i - -cond_exit_514.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_514.thread.i.i - %159 = add i64 %"511_1.sroa.10.0.i.i", 2 - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %cond_exit_514.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_514.thread.1.i.i - %166 = shl nuw i64 1, %163 - %167 = xor i64 %162, %166 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___dec_future_refcount(i64 %169) - br label %cond_exit_514.thread.2.i.i - -cond_exit_514.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_514.thread.1.i.i - %170 = add i64 %"511_1.sroa.10.0.i.i", 3 - %171 = lshr i64 %170, 6 - %172 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %171 - %173 = load i64, ptr %172, align 4 - %174 = and i64 %170, 63 - %175 = lshr i64 %173, %174 - %176 = trunc i64 %175 to i1 - br i1 %176, label %cond_exit_514.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_514.thread.2.i.i - %177 = shl nuw i64 1, %174 - %178 = xor i64 %173, %177 - store i64 %178, ptr %172, align 4 - %179 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %170 - %180 = load i64, ptr %179, align 4 - tail call void @___dec_future_refcount(i64 %180) - br label %cond_exit_514.thread.3.i.i - -cond_exit_514.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_514.thread.2.i.i - %181 = add i64 %"511_1.sroa.10.0.i.i", 4 - %182 = lshr i64 %181, 6 - %183 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %181, 63 - %186 = lshr i64 %184, %185 - %187 = trunc i64 %186 to i1 - br i1 %187, label %cond_exit_514.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_514.thread.3.i.i - %188 = shl nuw i64 1, %185 - %189 = xor i64 %184, %188 - store i64 %189, ptr %183, align 4 - %190 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %181 - %191 = load i64, ptr %190, align 4 - tail call void @___dec_future_refcount(i64 %191) - br label %cond_exit_514.thread.4.i.i - -cond_exit_514.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_514.thread.3.i.i - %192 = add i64 %"511_1.sroa.10.0.i.i", 5 - %193 = lshr i64 %192, 6 - %194 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %193 - %195 = load i64, ptr %194, align 4 - %196 = and i64 %192, 63 - %197 = lshr i64 %195, %196 - %198 = trunc i64 %197 to i1 - br i1 %198, label %cond_exit_514.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_514.thread.4.i.i - %199 = shl nuw i64 1, %196 - %200 = xor i64 %195, %199 - store i64 %200, ptr %194, align 4 - %201 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %192 - %202 = load i64, ptr %201, align 4 - tail call void @___dec_future_refcount(i64 %202) - br label %cond_exit_514.thread.5.i.i - -cond_exit_514.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_514.thread.4.i.i - %203 = add i64 %"511_1.sroa.10.0.i.i", 6 - %204 = lshr i64 %203, 6 - %205 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %204 - %206 = load i64, ptr %205, align 4 - %207 = and i64 %203, 63 - %208 = lshr i64 %206, %207 - %209 = trunc i64 %208 to i1 - br i1 %209, label %cond_exit_514.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_514.thread.5.i.i - %210 = shl nuw i64 1, %207 - %211 = xor i64 %206, %210 - store i64 %211, ptr %205, align 4 - %212 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %203 - %213 = load i64, ptr %212, align 4 - tail call void @___dec_future_refcount(i64 %213) - br label %cond_exit_514.thread.6.i.i - -cond_exit_514.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_514.thread.5.i.i - %214 = add i64 %"511_1.sroa.10.0.i.i", 7 - %215 = lshr i64 %214, 6 - %216 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %215 - %217 = load i64, ptr %216, align 4 - %218 = and i64 %214, 63 - %219 = lshr i64 %217, %218 - %220 = trunc i64 %219 to i1 - br i1 %220, label %cond_exit_514.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_514.thread.6.i.i - %221 = shl nuw i64 1, %218 - %222 = xor i64 %217, %221 - store i64 %222, ptr %216, align 4 - %223 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %214 - %224 = load i64, ptr %223, align 4 - tail call void @___dec_future_refcount(i64 %224) - br label %cond_exit_514.thread.7.i.i - -cond_exit_514.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_514.thread.6.i.i - %225 = add i64 %"511_1.sroa.10.0.i.i", 8 - %226 = lshr i64 %225, 6 - %227 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %226 - %228 = load i64, ptr %227, align 4 - %229 = and i64 %225, 63 - %230 = lshr i64 %228, %229 - %231 = trunc i64 %230 to i1 - br i1 %231, label %cond_exit_514.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_514.thread.7.i.i - %232 = shl nuw i64 1, %229 - %233 = xor i64 %228, %232 - store i64 %233, ptr %227, align 4 - %234 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %225 - %235 = load i64, ptr %234, align 4 - tail call void @___dec_future_refcount(i64 %235) - br label %cond_exit_514.thread.8.i.i - -cond_exit_514.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_514.thread.7.i.i - %236 = add i64 %"511_1.sroa.10.0.i.i", 9 - %237 = lshr i64 %236, 6 - %238 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %237 - %239 = load i64, ptr %238, align 4 - %240 = and i64 %236, 63 - %241 = lshr i64 %239, %240 - %242 = trunc i64 %241 to i1 - br i1 %242, label %cond_exit_514.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_514.thread.8.i.i - %243 = shl nuw i64 1, %240 - %244 = xor i64 %239, %243 - store i64 %244, ptr %238, align 4 - %245 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %236 - %246 = load i64, ptr %245, align 4 - tail call void @___dec_future_refcount(i64 %246) - br label %cond_exit_514.thread.9.i.i - -cond_exit_514.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_514.thread.8.i.i - %247 = load i64, ptr %119, align 4 - %248 = sub nuw nsw i64 64, %121 - %249 = lshr i64 -1, %248 - %250 = icmp eq i64 %121, 0 - %251 = select i1 %250, i64 0, i64 %249 - %252 = or i64 %247, %251 - store i64 %252, ptr %119, align 4 - %253 = load i64, ptr %238, align 4 - %254 = shl nsw i64 -2, %240 - %255 = icmp eq i64 %240, 63 - %256 = select i1 %255, i64 0, i64 %254 - %257 = or i64 %253, %256 - store i64 %257, ptr %238, align 4 - %reass.sub.i.i.i388 = sub nsw i64 %237, %118 - %.not.i.i.i389 = icmp eq i64 %reass.sub.i.i.i388, -1 - br i1 %.not.i.i.i389, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i390 - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %258 = xor i64 %137, %133 - store i64 %258, ptr %128, align 4 - store i64 %136, ptr %135, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %136) +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_487 + +cond_exit_487: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1206 = icmp eq i64 %113, 0 + br i1 %.not1206, label %__barray_mask_borrow.exit1167.1, label %cond_exit_487.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_487 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_487.1 + +cond_exit_487.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_487 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1207 = icmp eq i64 %118, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.2, label %cond_exit_487.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_487.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_487.2 + +cond_exit_487.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_487.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1208 = icmp eq i64 %123, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.3, label %cond_exit_487.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_487.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_487.3 + +cond_exit_487.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_487.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1209 = icmp eq i64 %128, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.4, label %cond_exit_487.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_487.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_487.4 + +cond_exit_487.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_487.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1210 = icmp eq i64 %133, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.5, label %cond_exit_487.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_487.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 tail call void @___dec_future_refcount(i64 %136) - %259 = load i64, ptr %117, align 4 - %260 = lshr i64 %259, %"229_0.sroa.15.0168.i" - %261 = trunc i64 %260 to i1 - br i1 %261, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %262 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %125, 1 - %263 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %264 = xor i64 %259, %263 - store i64 %264, ptr %117, align 4 - %265 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %265, align 1 - %266 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %125, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %140, %cond_exit_514.thread.9.i.i - tail call void @heap_free(ptr %"511_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"511_1.sroa.5.0.i.i") - %267 = load i64, ptr %117, align 4 - %268 = and i64 %267, 1023 - store i64 %268, ptr %117, align 4 - %269 = icmp eq i64 %268, 0 - br i1 %269, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" + br label %cond_exit_487.5 + +cond_exit_487.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_487.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1211 = icmp eq i64 %138, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.6, label %cond_exit_487.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_487.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_487.6 + +cond_exit_487.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_487.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1212 = icmp eq i64 %143, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.7, label %cond_exit_487.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_487.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_487.7 + +cond_exit_487.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_487.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1213 = icmp eq i64 %148, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.8, label %cond_exit_487.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_487.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_487.8 + +cond_exit_487.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_487.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1214 = icmp eq i64 %153, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.9, label %cond_exit_487.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_487.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_487.9 + +cond_exit_487.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_487.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_487, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_487.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %270 = tail call ptr @heap_alloc(i64 10) - %271 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %271, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %270, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %270) - %272 = load i64, ptr %117, align 4 - %273 = and i64 %272, 1023 - store i64 %273, ptr %117, align 4 - %274 = icmp eq i64 %273, 0 - br i1 %274, label %__barray_check_none_borrowed.exit400, label %mask_block_err.i399 - -mask_block_err.i399: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %275 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %275, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %275, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -730,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-apple-darwin.ll index e6226199..8e546f44 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-apple-darwin.ll @@ -3,567 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_491_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_441_case_0.i, label %__barray_check_bounds.exit -cond_491_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_441_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_491_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_441_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_491_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_441_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not418 = icmp eq i64 %10, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1199 = icmp eq i64 %14, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_491_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_441_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not419 = icmp eq i64 %14, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1200 = icmp eq i64 %18, 0 + br i1 %.not1200, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_491_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_441_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not420 = icmp eq i64 %18, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1201 = icmp eq i64 %22, 0 + br i1 %.not1201, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_491_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_441_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not421 = icmp eq i64 %22, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1202 = icmp eq i64 %26, 0 + br i1 %.not1202, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_491_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_441_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not422 = icmp eq i64 %26, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1203 = icmp eq i64 %30, 0 + br i1 %.not1203, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_491_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_441_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not423 = icmp eq i64 %30, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1204 = icmp eq i64 %34, 0 + br i1 %.not1204, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_491_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_441_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not424 = icmp eq i64 %34, 0 - br i1 %.not424, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1205 = icmp eq i64 %38, 0 + br i1 %.not1205, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_491_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_441_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not425 = icmp eq i64 %38, 0 - br i1 %.not425, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1206 = icmp eq i64 %42, 0 + br i1 %.not1206, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0416" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0416", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0416" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0416" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0416" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0416" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rp(i64 %55, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %55, i64 %61, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %61, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %55, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0416" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rp(i64 %59, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %59, i64 %65, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %65, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %59, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond417.not = icmp eq i64 %48, 9 - br i1 %exitcond417.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond1192 = icmp eq i64 %74, 10 + br i1 %exitcond1192, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01196" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"511_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 2 - %"511_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 1 - %"511_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %118 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %175, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %119, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %171, %loop_body.i386 ] - %119 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %118, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %118, 1 - %120 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %121 = lshr i64 %120, 6 - %122 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %120, 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %panic.i.i.i399, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i399: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01197" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01196" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01197", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01197" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %118, 0 - %127 = shl nuw i64 1, %124 - %128 = xor i64 %127, %123 - store i64 %128, ptr %122, align 4 - %129 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %120 - %130 = load i64, ptr %129, align 4 - tail call void @___inc_future_refcount(i64 %130) - %131 = load i64, ptr %122, align 4 - %132 = lshr i64 %131, %124 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01197" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01197" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01196", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01196", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01196" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01196" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01197", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_514_case_0.i.i: ; preds = %cond_exit_514.thread.i.i - %134 = lshr i64 %"511_1.sroa.10.0.i.i", 6 - %135 = getelementptr i64, ptr %"511_1.sroa.5.0.i.i", i64 %134 - %136 = load i64, ptr %135, align 4 - %137 = and i64 %"511_1.sroa.10.0.i.i", 63 - %138 = sub nuw nsw i64 64, %137 - %139 = lshr i64 -1, %138 - %140 = icmp eq i64 %137, 0 - %141 = select i1 %140, i64 0, i64 %139 - %142 = or i64 %136, %141 - store i64 %142, ptr %135, align 4 - %last_valid.i.i.i388 = add i64 %"511_1.sroa.10.0.i.i", 9 - %143 = lshr i64 %last_valid.i.i.i388, 6 - %144 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %143 - %145 = load i64, ptr %144, align 4 - %146 = and i64 %last_valid.i.i.i388, 63 - %147 = shl nsw i64 -2, %146 - %148 = icmp eq i64 %146, 63 - %149 = select i1 %148, i64 0, i64 %147 - %150 = or i64 %145, %149 - store i64 %150, ptr %144, align 4 - %reass.sub.i.i.i389 = sub nsw i64 %143, %134 - %.not.i.i.i390 = icmp eq i64 %reass.sub.i.i.i389, -1 - br i1 %.not.i.i.i390, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -151: ; preds = %mask_block_ok.i.i.i391 - %152 = add nuw i64 %.02.i.i.i392, 1 - %exitcond.not.i.i.i395 = icmp eq i64 %.02.i.i.i392, %reass.sub.i.i.i389 - br i1 %exitcond.not.i.i.i395, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -mask_block_ok.i.i.i391: ; preds = %cond_514_case_0.i.i, %151 - %.02.i.i.i392 = phi i64 [ %152, %151 ], [ 0, %cond_514_case_0.i.i ] - %gep.i.i.i393 = getelementptr i64, ptr %135, i64 %.02.i.i.i392 - %153 = load i64, ptr %gep.i.i.i393, align 4 - %154 = icmp eq i64 %153, -1 - br i1 %154, label %151, label %mask_block_err.i.i.i394 - -mask_block_err.i.i.i394: ; preds = %mask_block_ok.i.i.i391 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_514.thread.i.i, %loop_body.preheader.i.i - %"511_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %155, %cond_exit_514.thread.i.i ] - %155 = add nuw nsw i64 %"511_0.0239.i.i", 1 - %156 = add i64 %"511_0.0239.i.i", %"511_1.sroa.10.0.i.i" - %157 = lshr i64 %156, 6 - %158 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %157 - %159 = load i64, ptr %158, align 4 - %160 = and i64 %156, 63 - %161 = lshr i64 %159, %160 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_514.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %163 = shl nuw i64 1, %160 - %164 = xor i64 %163, %159 - store i64 %164, ptr %158, align 4 - %165 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %156 - %166 = load i64, ptr %165, align 4 - tail call void @___dec_future_refcount(i64 %166) - br label %cond_exit_514.thread.i.i - -cond_exit_514.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %155, 10 - br i1 %exitcond.i.i, label %cond_514_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %167 = xor i64 %131, %127 - store i64 %167, ptr %122, align 4 - store i64 %130, ptr %129, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %130) - tail call void @___dec_future_refcount(i64 %130) - %168 = load i64, ptr %117, align 4 - %169 = lshr i64 %168, %"229_0.sroa.15.0168.i" - %170 = trunc i64 %169 to i1 - br i1 %170, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 + +panic.i1154: ; preds = %__barray_check_bounds.exit1153 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %171 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %119, 1 - %172 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %173 = xor i64 %168, %172 - store i64 %173, ptr %117, align 4 - %174 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %174, align 1 - %175 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %119, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %151, %cond_514_case_0.i.i - tail call void @heap_free(ptr %"511_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"511_1.sroa.5.0.i.i") - %176 = load i64, ptr %117, align 4 - %177 = and i64 %176, 1023 - store i64 %177, ptr %117, align 4 - %178 = icmp eq i64 %177, 0 - br i1 %178, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" +mask_block_err.i1159: ; preds = %cond_exit_487.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_487 + +cond_exit_487: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1207 = icmp eq i64 %113, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.1, label %cond_exit_487.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_487 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_487.1 + +cond_exit_487.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_487 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1208 = icmp eq i64 %118, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.2, label %cond_exit_487.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_487.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_487.2 + +cond_exit_487.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_487.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1209 = icmp eq i64 %123, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.3, label %cond_exit_487.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_487.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_487.3 + +cond_exit_487.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_487.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1210 = icmp eq i64 %128, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.4, label %cond_exit_487.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_487.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_487.4 + +cond_exit_487.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_487.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1211 = icmp eq i64 %133, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.5, label %cond_exit_487.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_487.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_487.5 + +cond_exit_487.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_487.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1212 = icmp eq i64 %138, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.6, label %cond_exit_487.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_487.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_487.6 + +cond_exit_487.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_487.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1213 = icmp eq i64 %143, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.7, label %cond_exit_487.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_487.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_487.7 + +cond_exit_487.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_487.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1214 = icmp eq i64 %148, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.8, label %cond_exit_487.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_487.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_487.8 + +cond_exit_487.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_487.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1215 = icmp eq i64 %153, 0 + br i1 %.not1215, label %__barray_mask_borrow.exit1167.9, label %cond_exit_487.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_487.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_487.9 + +cond_exit_487.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_487.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_487, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_487.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %179 = tail call ptr @heap_alloc(i64 10) - %180 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %180, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %179, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %179) - %181 = load i64, ptr %117, align 4 - %182 = and i64 %181, 1023 - store i64 %182, ptr %117, align 4 - %183 = icmp eq i64 %182, 0 - br i1 %183, label %__barray_check_none_borrowed.exit401, label %mask_block_err.i400 - -mask_block_err.i400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit401: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %184 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %184, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %184, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -576,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-unknown-linux-gnu.ll index bf071a93..bdf547f3 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-unknown-linux-gnu.ll @@ -3,567 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_491_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_441_case_0.i, label %__barray_check_bounds.exit -cond_491_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_441_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_491_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_441_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_491_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_441_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not418 = icmp eq i64 %10, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1199 = icmp eq i64 %14, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_491_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_441_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not419 = icmp eq i64 %14, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1200 = icmp eq i64 %18, 0 + br i1 %.not1200, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_491_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_441_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not420 = icmp eq i64 %18, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1201 = icmp eq i64 %22, 0 + br i1 %.not1201, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_491_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_441_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not421 = icmp eq i64 %22, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1202 = icmp eq i64 %26, 0 + br i1 %.not1202, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_491_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_441_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not422 = icmp eq i64 %26, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1203 = icmp eq i64 %30, 0 + br i1 %.not1203, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_491_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_441_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not423 = icmp eq i64 %30, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1204 = icmp eq i64 %34, 0 + br i1 %.not1204, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_491_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_441_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not424 = icmp eq i64 %34, 0 - br i1 %.not424, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1205 = icmp eq i64 %38, 0 + br i1 %.not1205, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_491_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_441_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not425 = icmp eq i64 %38, 0 - br i1 %.not425, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1206 = icmp eq i64 %42, 0 + br i1 %.not1206, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0416" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0416", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0416" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0416" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0416" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0416" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rp(i64 %55, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %55, i64 %61, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %61, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %55, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0416" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rp(i64 %59, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %59, i64 %65, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %65, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %59, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond417.not = icmp eq i64 %48, 9 - br i1 %exitcond417.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond1192 = icmp eq i64 %74, 10 + br i1 %exitcond1192, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01196" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"511_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 2 - %"511_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 1 - %"511_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %118 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %175, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %119, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %171, %loop_body.i386 ] - %119 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %118, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %118, 1 - %120 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %121 = lshr i64 %120, 6 - %122 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %120, 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %panic.i.i.i399, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i399: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01197" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01196" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01197", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01197" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %118, 0 - %127 = shl nuw i64 1, %124 - %128 = xor i64 %127, %123 - store i64 %128, ptr %122, align 4 - %129 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %120 - %130 = load i64, ptr %129, align 4 - tail call void @___inc_future_refcount(i64 %130) - %131 = load i64, ptr %122, align 4 - %132 = lshr i64 %131, %124 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01197" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01197" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01196", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01196", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01196" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01196" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01197", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_514_case_0.i.i: ; preds = %cond_exit_514.thread.i.i - %134 = lshr i64 %"511_1.sroa.10.0.i.i", 6 - %135 = getelementptr i64, ptr %"511_1.sroa.5.0.i.i", i64 %134 - %136 = load i64, ptr %135, align 4 - %137 = and i64 %"511_1.sroa.10.0.i.i", 63 - %138 = sub nuw nsw i64 64, %137 - %139 = lshr i64 -1, %138 - %140 = icmp eq i64 %137, 0 - %141 = select i1 %140, i64 0, i64 %139 - %142 = or i64 %136, %141 - store i64 %142, ptr %135, align 4 - %last_valid.i.i.i388 = add i64 %"511_1.sroa.10.0.i.i", 9 - %143 = lshr i64 %last_valid.i.i.i388, 6 - %144 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %143 - %145 = load i64, ptr %144, align 4 - %146 = and i64 %last_valid.i.i.i388, 63 - %147 = shl nsw i64 -2, %146 - %148 = icmp eq i64 %146, 63 - %149 = select i1 %148, i64 0, i64 %147 - %150 = or i64 %145, %149 - store i64 %150, ptr %144, align 4 - %reass.sub.i.i.i389 = sub nsw i64 %143, %134 - %.not.i.i.i390 = icmp eq i64 %reass.sub.i.i.i389, -1 - br i1 %.not.i.i.i390, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -151: ; preds = %mask_block_ok.i.i.i391 - %152 = add nuw i64 %.02.i.i.i392, 1 - %exitcond.not.i.i.i395 = icmp eq i64 %.02.i.i.i392, %reass.sub.i.i.i389 - br i1 %exitcond.not.i.i.i395, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -mask_block_ok.i.i.i391: ; preds = %cond_514_case_0.i.i, %151 - %.02.i.i.i392 = phi i64 [ %152, %151 ], [ 0, %cond_514_case_0.i.i ] - %gep.i.i.i393 = getelementptr i64, ptr %135, i64 %.02.i.i.i392 - %153 = load i64, ptr %gep.i.i.i393, align 4 - %154 = icmp eq i64 %153, -1 - br i1 %154, label %151, label %mask_block_err.i.i.i394 - -mask_block_err.i.i.i394: ; preds = %mask_block_ok.i.i.i391 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_514.thread.i.i, %loop_body.preheader.i.i - %"511_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %155, %cond_exit_514.thread.i.i ] - %155 = add nuw nsw i64 %"511_0.0239.i.i", 1 - %156 = add i64 %"511_0.0239.i.i", %"511_1.sroa.10.0.i.i" - %157 = lshr i64 %156, 6 - %158 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %157 - %159 = load i64, ptr %158, align 4 - %160 = and i64 %156, 63 - %161 = lshr i64 %159, %160 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_514.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %163 = shl nuw i64 1, %160 - %164 = xor i64 %163, %159 - store i64 %164, ptr %158, align 4 - %165 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %156 - %166 = load i64, ptr %165, align 4 - tail call void @___dec_future_refcount(i64 %166) - br label %cond_exit_514.thread.i.i - -cond_exit_514.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %155, 10 - br i1 %exitcond.i.i, label %cond_514_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %167 = xor i64 %131, %127 - store i64 %167, ptr %122, align 4 - store i64 %130, ptr %129, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %130) - tail call void @___dec_future_refcount(i64 %130) - %168 = load i64, ptr %117, align 4 - %169 = lshr i64 %168, %"229_0.sroa.15.0168.i" - %170 = trunc i64 %169 to i1 - br i1 %170, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 + +panic.i1154: ; preds = %__barray_check_bounds.exit1153 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %171 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %119, 1 - %172 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %173 = xor i64 %168, %172 - store i64 %173, ptr %117, align 4 - %174 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %174, align 1 - %175 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %119, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %151, %cond_514_case_0.i.i - tail call void @heap_free(ptr %"511_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"511_1.sroa.5.0.i.i") - %176 = load i64, ptr %117, align 4 - %177 = and i64 %176, 1023 - store i64 %177, ptr %117, align 4 - %178 = icmp eq i64 %177, 0 - br i1 %178, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" +mask_block_err.i1159: ; preds = %cond_exit_487.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_487 + +cond_exit_487: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1207 = icmp eq i64 %113, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.1, label %cond_exit_487.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_487 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_487.1 + +cond_exit_487.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_487 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1208 = icmp eq i64 %118, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.2, label %cond_exit_487.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_487.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_487.2 + +cond_exit_487.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_487.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1209 = icmp eq i64 %123, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.3, label %cond_exit_487.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_487.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_487.3 + +cond_exit_487.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_487.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1210 = icmp eq i64 %128, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.4, label %cond_exit_487.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_487.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_487.4 + +cond_exit_487.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_487.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1211 = icmp eq i64 %133, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.5, label %cond_exit_487.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_487.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_487.5 + +cond_exit_487.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_487.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1212 = icmp eq i64 %138, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.6, label %cond_exit_487.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_487.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_487.6 + +cond_exit_487.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_487.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1213 = icmp eq i64 %143, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.7, label %cond_exit_487.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_487.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_487.7 + +cond_exit_487.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_487.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1214 = icmp eq i64 %148, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.8, label %cond_exit_487.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_487.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_487.8 + +cond_exit_487.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_487.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1215 = icmp eq i64 %153, 0 + br i1 %.not1215, label %__barray_mask_borrow.exit1167.9, label %cond_exit_487.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_487.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_487.9 + +cond_exit_487.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_487.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_487, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_487.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %179 = tail call ptr @heap_alloc(i64 10) - %180 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %180, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %179, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %179) - %181 = load i64, ptr %117, align 4 - %182 = and i64 %181, 1023 - store i64 %182, ptr %117, align 4 - %183 = icmp eq i64 %182, 0 - br i1 %183, label %__barray_check_none_borrowed.exit401, label %mask_block_err.i400 - -mask_block_err.i400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit401: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %184 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %184, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %184, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -576,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-windows-gnu.ll index 9667619f..837fd720 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_trace/test_ghz_trace/trace_test-sol-x86_64-windows-gnu.ll @@ -3,567 +3,590 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_outcomes.9CB6D2E7.0 = private constant [22 x i8] c"\15USER:BOOLARR:outcomes" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 80) + %5 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %5, align 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_491_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_441_case_0.i, label %__barray_check_bounds.exit -cond_491_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_441_case_0.i: ; preds = %cond_exit_12.8, %cond_exit_12.7, %cond_exit_12.6, %cond_exit_12.5, %cond_exit_12.4, %cond_exit_12.3, %cond_exit_12.2, %cond_exit_12.1, %cond_exit_12, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable __barray_check_bounds.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %6 = load i64, ptr %5, align 4 + %7 = trunc i64 %6 to i1 + br i1 %7, label %cond_exit_12, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 +cond_exit_12: ; preds = %__barray_check_bounds.exit + %8 = and i64 %6, -2 + store i64 %8, ptr %5, align 4 + store i64 %qalloc.i, ptr %4, align 4 %qalloc.i.1 = tail call i64 @___qalloc() %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_491_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_441_case_0.i, label %__barray_check_bounds.exit.1 -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 +__barray_check_bounds.exit.1: ; preds = %cond_exit_12 tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 + %9 = load i64, ptr %5, align 4 + %10 = and i64 %9, 2 + %.not = icmp eq i64 %10, 0 + br i1 %.not, label %panic.i, label %cond_exit_12.1 + +cond_exit_12.1: ; preds = %__barray_check_bounds.exit.1 + %11 = and i64 %9, -3 + store i64 %11, ptr %5, align 4 + %12 = getelementptr inbounds nuw i8, ptr %4, i64 8 + store i64 %qalloc.i.1, ptr %12, align 4 %qalloc.i.2 = tail call i64 @___qalloc() %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_491_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_441_case_0.i, label %__barray_check_bounds.exit.2 -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 +__barray_check_bounds.exit.2: ; preds = %cond_exit_12.1 tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not418 = icmp eq i64 %10, 0 - br i1 %.not418, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 + %13 = load i64, ptr %5, align 4 + %14 = and i64 %13, 4 + %.not1199 = icmp eq i64 %14, 0 + br i1 %.not1199, label %panic.i, label %cond_exit_12.2 + +cond_exit_12.2: ; preds = %__barray_check_bounds.exit.2 + %15 = and i64 %13, -5 + store i64 %15, ptr %5, align 4 + %16 = getelementptr inbounds nuw i8, ptr %4, i64 16 + store i64 %qalloc.i.2, ptr %16, align 4 %qalloc.i.3 = tail call i64 @___qalloc() %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_491_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_441_case_0.i, label %__barray_check_bounds.exit.3 -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 +__barray_check_bounds.exit.3: ; preds = %cond_exit_12.2 tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not419 = icmp eq i64 %14, 0 - br i1 %.not419, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 + %17 = load i64, ptr %5, align 4 + %18 = and i64 %17, 8 + %.not1200 = icmp eq i64 %18, 0 + br i1 %.not1200, label %panic.i, label %cond_exit_12.3 + +cond_exit_12.3: ; preds = %__barray_check_bounds.exit.3 + %19 = and i64 %17, -9 + store i64 %19, ptr %5, align 4 + %20 = getelementptr inbounds nuw i8, ptr %4, i64 24 + store i64 %qalloc.i.3, ptr %20, align 4 %qalloc.i.4 = tail call i64 @___qalloc() %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_491_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_441_case_0.i, label %__barray_check_bounds.exit.4 -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 +__barray_check_bounds.exit.4: ; preds = %cond_exit_12.3 tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not420 = icmp eq i64 %18, 0 - br i1 %.not420, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 + %21 = load i64, ptr %5, align 4 + %22 = and i64 %21, 16 + %.not1201 = icmp eq i64 %22, 0 + br i1 %.not1201, label %panic.i, label %cond_exit_12.4 + +cond_exit_12.4: ; preds = %__barray_check_bounds.exit.4 + %23 = and i64 %21, -17 + store i64 %23, ptr %5, align 4 + %24 = getelementptr inbounds nuw i8, ptr %4, i64 32 + store i64 %qalloc.i.4, ptr %24, align 4 %qalloc.i.5 = tail call i64 @___qalloc() %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_491_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_441_case_0.i, label %__barray_check_bounds.exit.5 -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 +__barray_check_bounds.exit.5: ; preds = %cond_exit_12.4 tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not421 = icmp eq i64 %22, 0 - br i1 %.not421, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 + %25 = load i64, ptr %5, align 4 + %26 = and i64 %25, 32 + %.not1202 = icmp eq i64 %26, 0 + br i1 %.not1202, label %panic.i, label %cond_exit_12.5 + +cond_exit_12.5: ; preds = %__barray_check_bounds.exit.5 + %27 = and i64 %25, -33 + store i64 %27, ptr %5, align 4 + %28 = getelementptr inbounds nuw i8, ptr %4, i64 40 + store i64 %qalloc.i.5, ptr %28, align 4 %qalloc.i.6 = tail call i64 @___qalloc() %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_491_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_441_case_0.i, label %__barray_check_bounds.exit.6 -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 +__barray_check_bounds.exit.6: ; preds = %cond_exit_12.5 tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not422 = icmp eq i64 %26, 0 - br i1 %.not422, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 + %29 = load i64, ptr %5, align 4 + %30 = and i64 %29, 64 + %.not1203 = icmp eq i64 %30, 0 + br i1 %.not1203, label %panic.i, label %cond_exit_12.6 + +cond_exit_12.6: ; preds = %__barray_check_bounds.exit.6 + %31 = and i64 %29, -65 + store i64 %31, ptr %5, align 4 + %32 = getelementptr inbounds nuw i8, ptr %4, i64 48 + store i64 %qalloc.i.6, ptr %32, align 4 %qalloc.i.7 = tail call i64 @___qalloc() %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_491_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_441_case_0.i, label %__barray_check_bounds.exit.7 -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 +__barray_check_bounds.exit.7: ; preds = %cond_exit_12.6 tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not423 = icmp eq i64 %30, 0 - br i1 %.not423, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 + %33 = load i64, ptr %5, align 4 + %34 = and i64 %33, 128 + %.not1204 = icmp eq i64 %34, 0 + br i1 %.not1204, label %panic.i, label %cond_exit_12.7 + +cond_exit_12.7: ; preds = %__barray_check_bounds.exit.7 + %35 = and i64 %33, -129 + store i64 %35, ptr %5, align 4 + %36 = getelementptr inbounds nuw i8, ptr %4, i64 56 + store i64 %qalloc.i.7, ptr %36, align 4 %qalloc.i.8 = tail call i64 @___qalloc() %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_491_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_441_case_0.i, label %__barray_check_bounds.exit.8 -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 +__barray_check_bounds.exit.8: ; preds = %cond_exit_12.7 tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not424 = icmp eq i64 %34, 0 - br i1 %.not424, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 + %37 = load i64, ptr %5, align 4 + %38 = and i64 %37, 256 + %.not1205 = icmp eq i64 %38, 0 + br i1 %.not1205, label %panic.i, label %cond_exit_12.8 + +cond_exit_12.8: ; preds = %__barray_check_bounds.exit.8 + %39 = and i64 %37, -257 + store i64 %39, ptr %5, align 4 + %40 = getelementptr inbounds nuw i8, ptr %4, i64 64 + store i64 %qalloc.i.8, ptr %40, align 4 %qalloc.i.9 = tail call i64 @___qalloc() %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_491_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_441_case_0.i, label %__barray_check_bounds.exit.9 -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 +__barray_check_bounds.exit.9: ; preds = %cond_exit_12.8 tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not425 = icmp eq i64 %38, 0 - br i1 %.not425, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %41 = load i64, ptr %1, align 4 - %42 = trunc i64 %41 to i1 - br i1 %42, label %panic.i364, label %__barray_mask_borrow.exit - -panic.i364: ; preds = %cond_exit_20.9 + %41 = load i64, ptr %5, align 4 + %42 = and i64 %41, 512 + %.not1206 = icmp eq i64 %42, 0 + br i1 %.not1206, label %panic.i, label %cond_exit_12.9 + +cond_exit_12.9: ; preds = %__barray_check_bounds.exit.9 + %43 = and i64 %41, -513 + store i64 %43, ptr %5, align 4 + %44 = getelementptr inbounds nuw i8, ptr %4, i64 72 + store i64 %qalloc.i.9, ptr %44, align 4 + %45 = load i64, ptr %5, align 4 + %46 = trunc i64 %45 to i1 + br i1 %46, label %panic.i1117, label %__barray_mask_borrow.exit + +panic.i1117: ; preds = %cond_exit_12.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit: ; preds = %cond_exit_20.9 - %43 = or disjoint i64 %41, 1 - store i64 %43, ptr %1, align 4 - %44 = load i64, ptr %0, align 4 - tail call void @___rp(i64 %44, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %44, double 0x400921FB54442D18) - %45 = load i64, ptr %1, align 4 - %46 = trunc i64 %45 to i1 - br i1 %46, label %__barray_mask_return.exit366, label %panic.i365 - -panic.i365: ; preds = %__barray_mask_borrow.exit +__barray_mask_borrow.exit: ; preds = %cond_exit_12.9 + %47 = or disjoint i64 %45, 1 + store i64 %47, ptr %5, align 4 + %48 = load i64, ptr %4, align 4 + tail call void @___rp(i64 %48, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %48, double 0x400921FB54442D18) + %49 = load i64, ptr %5, align 4 + %50 = trunc i64 %49 to i1 + br i1 %50, label %__barray_mask_return.exit1119, label %panic.i1118 + +panic.i1118: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit366: ; preds = %__barray_mask_borrow.exit - %47 = and i64 %45, -2 - store i64 %47, ptr %1, align 4 - store i64 %44, ptr %0, align 4 - br label %__barray_check_bounds.exit368 - -__barray_check_bounds.exit368: ; preds = %__barray_mask_return.exit382, %__barray_mask_return.exit366 - %"54_0.0416" = phi i64 [ 0, %__barray_mask_return.exit366 ], [ %48, %__barray_mask_return.exit382 ] - %48 = add nuw nsw i64 %"54_0.0416", 1 - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"54_0.0416" - %51 = trunc i64 %50 to i1 - br i1 %51, label %panic.i369, label %__barray_mask_borrow.exit370 - -panic.i369: ; preds = %__barray_check_bounds.exit368 +__barray_mask_return.exit1119: ; preds = %__barray_mask_borrow.exit + %51 = and i64 %49, -2 + store i64 %51, ptr %5, align 4 + store i64 %48, ptr %4, align 4 + br label %__barray_check_bounds.exit1121 + +__barray_check_bounds.exit1121: ; preds = %__barray_mask_return.exit1119, %__barray_mask_return.exit1135 + %52 = phi i64 [ 1, %__barray_mask_return.exit1119 ], [ %74, %__barray_mask_return.exit1135 ] + %"116_0.01189" = phi i64 [ 0, %__barray_mask_return.exit1119 ], [ %52, %__barray_mask_return.exit1135 ] + %53 = load i64, ptr %5, align 4 + %54 = lshr i64 %53, %"116_0.01189" + %55 = trunc i64 %54 to i1 + br i1 %55, label %panic.i1122, label %__barray_check_bounds.exit1125 + +panic.i1122: ; preds = %__barray_check_bounds.exit1121 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_mask_borrow.exit370: ; preds = %__barray_check_bounds.exit368 - %52 = shl nuw nsw i64 1, %"54_0.0416" - %53 = xor i64 %49, %52 - store i64 %53, ptr %1, align 4 - %54 = getelementptr inbounds nuw i64, ptr %0, i64 %"54_0.0416" - %55 = load i64, ptr %54, align 4 - %56 = lshr i64 %53, %48 - %57 = trunc i64 %56 to i1 - br i1 %57, label %panic.i373, label %__barray_check_bounds.exit376 - -panic.i373: ; preds = %__barray_mask_borrow.exit370 +__barray_check_bounds.exit1125: ; preds = %__barray_check_bounds.exit1121 + %56 = shl nuw nsw i64 1, %"116_0.01189" + %57 = xor i64 %53, %56 + store i64 %57, ptr %5, align 4 + %58 = getelementptr inbounds nuw i64, ptr %4, i64 %"116_0.01189" + %59 = load i64, ptr %58, align 4 + %60 = lshr i64 %57, %52 + %61 = trunc i64 %60 to i1 + br i1 %61, label %panic.i1126, label %__barray_check_bounds.exit1129 + +panic.i1126: ; preds = %__barray_check_bounds.exit1125 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit376: ; preds = %__barray_mask_borrow.exit370 - %58 = shl nuw nsw i64 2, %"54_0.0416" - %59 = xor i64 %53, %58 - store i64 %59, ptr %1, align 4 - %60 = getelementptr inbounds nuw i64, ptr %0, i64 %48 - %61 = load i64, ptr %60, align 4 - tail call void @___rp(i64 %55, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rpp(i64 %55, i64 %61, double 0x3FF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %61, double 0xBFF921FB54442D18, double 0.000000e+00) - tail call void @___rp(i64 %55, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) - tail call void @___rz(i64 %55, double 0xBFF921FB54442D18) - %62 = load i64, ptr %1, align 4 - %63 = lshr i64 %62, %"54_0.0416" - %64 = trunc i64 %63 to i1 - br i1 %64, label %__barray_check_bounds.exit380, label %panic.i377 - -panic.i377: ; preds = %__barray_check_bounds.exit376 +__barray_check_bounds.exit1129: ; preds = %__barray_check_bounds.exit1125 + %62 = shl nuw nsw i64 2, %"116_0.01189" + %63 = xor i64 %57, %62 + store i64 %63, ptr %5, align 4 + %64 = getelementptr inbounds nuw i64, ptr %4, i64 %52 + %65 = load i64, ptr %64, align 4 + tail call void @___rp(i64 %59, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rpp(i64 %59, i64 %65, double 0x3FF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %65, double 0xBFF921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %59, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) + tail call void @___rz(i64 %59, double 0xBFF921FB54442D18) + %66 = load i64, ptr %5, align 4 + %67 = lshr i64 %66, %"116_0.01189" + %68 = trunc i64 %67 to i1 + br i1 %68, label %__barray_check_bounds.exit1133, label %panic.i1130 + +panic.i1130: ; preds = %__barray_check_bounds.exit1129 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit380: ; preds = %__barray_check_bounds.exit376 - %65 = xor i64 %62, %52 - store i64 %65, ptr %1, align 4 - store i64 %55, ptr %54, align 4 - %66 = load i64, ptr %1, align 4 - %67 = lshr i64 %66, %48 - %68 = trunc i64 %67 to i1 - br i1 %68, label %__barray_mask_return.exit382, label %panic.i381 +__barray_check_bounds.exit1133: ; preds = %__barray_check_bounds.exit1129 + %69 = xor i64 %66, %56 + store i64 %69, ptr %5, align 4 + store i64 %59, ptr %58, align 4 + %70 = load i64, ptr %5, align 4 + %71 = lshr i64 %70, %52 + %72 = trunc i64 %71 to i1 + br i1 %72, label %__barray_mask_return.exit1135, label %panic.i1134 -panic.i381: ; preds = %__barray_check_bounds.exit380 +panic.i1134: ; preds = %__barray_check_bounds.exit1133 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit382: ; preds = %__barray_check_bounds.exit380 - %69 = xor i64 %66, %58 - store i64 %69, ptr %1, align 4 - store i64 %61, ptr %60, align 4 - %exitcond417.not = icmp eq i64 %48, 9 - br i1 %exitcond417.not, label %cond_exit_89, label %__barray_check_bounds.exit368 - -cond_exit_89: ; preds = %__barray_mask_return.exit382 - %"54_380.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"54_380.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.0.insert", ptr %1, 1 - %"54_380.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"54_380.fca.1.insert", i64 0, 2 - %70 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"54_380.fca.2.insert", 0 - %71 = tail call ptr @heap_alloc(i64 80) - %72 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %72, align 1 - br label %__barray_check_bounds.exit.i.i - -73: ; preds = %loop_body.i - %74 = lshr i64 %.fca.2.extract.i.i, 6 - %75 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %74 - %76 = load i64, ptr %75, align 4 - %77 = and i64 %.fca.2.extract.i.i, 63 - %78 = sub nuw nsw i64 64, %77 - %79 = lshr i64 -1, %78 - %80 = icmp eq i64 %77, 0 - %81 = select i1 %80, i64 0, i64 %79 - %82 = or i64 %76, %81 - store i64 %82, ptr %75, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %83 = lshr i64 %last_valid.i.i.i, 6 - %84 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %83 - %85 = load i64, ptr %84, align 4 - %86 = and i64 %last_valid.i.i.i, 63 - %87 = shl nsw i64 -2, %86 - %88 = icmp eq i64 %86, 63 - %89 = select i1 %88, i64 0, i64 %87 - %90 = or i64 %85, %89 - store i64 %90, ptr %84, align 4 - %reass.sub.i.i.i = sub nsw i64 %83, %74 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -91: ; preds = %mask_block_ok.i.i.i - %92 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %73, %91 - %.02.i.i.i = phi i64 [ %92, %91 ], [ 0, %73 ] - %gep.i.i.i = getelementptr i64, ptr %75, i64 %.02.i.i.i - %93 = load i64, ptr %gep.i.i.i, align 4 - %94 = icmp eq i64 %93, -1 - br i1 %94, label %91, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable +__barray_mask_return.exit1135: ; preds = %__barray_check_bounds.exit1133 + %73 = xor i64 %70, %62 + store i64 %73, ptr %5, align 4 + store i64 %65, ptr %64, align 4 + %74 = add nuw nsw i64 %52, 1 + %exitcond1192 = icmp eq i64 %74, 10 + br i1 %exitcond1192, label %loop_body346.preheader, label %__barray_check_bounds.exit1121 -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_89 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_89 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_89 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_89 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"270_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_89 ], [ %95, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %70, %cond_exit_89 ], [ %110, %loop_body.i ] - %95 = add nuw nsw i64 %"270_0.sroa.15.0178.i", 1 - %96 = add i64 %"270_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %97 = lshr i64 %96, 6 - %98 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %97 - %99 = load i64, ptr %98, align 4 - %100 = and i64 %96, 63 - %101 = lshr i64 %99, %100 - %102 = trunc i64 %101 to i1 - br i1 %102, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +out_of_bounds.i1136: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %103 = shl nuw i64 1, %100 - %104 = xor i64 %103, %99 - store i64 %104, ptr %98, align 4 - %105 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %96 - %106 = load i64, ptr %105, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %106) - tail call void @___qfree(i64 %106) - %107 = load i64, ptr %72, align 4 - %108 = lshr i64 %107, %"270_0.sroa.15.0178.i" - %109 = trunc i64 %108 to i1 - br i1 %109, label %loop_body.i, label %panic.i.i +__barray_check_bounds.exit1137: ; preds = %.thread + %75 = load i64, ptr %3, align 4 + %76 = lshr i64 %75, %"237_2.01196" + %77 = trunc i64 %76 to i1 + br i1 %77, label %cond_exit_241, label %panic.i1138 -panic.i.i: ; preds = %__barray_check_bounds.exit.i +panic.i1138: ; preds = %__barray_check_bounds.exit1137 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %110 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %95, 1 - %111 = shl nuw nsw i64 1, %"270_0.sroa.15.0178.i" - %112 = xor i64 %107, %111 - store i64 %112, ptr %72, align 4 - %113 = getelementptr inbounds nuw i64, ptr %71, i64 %"270_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %113, align 4 - %114 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %114, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %114, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %114, 2 - %exitcond.not.i = icmp eq i64 %95, 10 - br i1 %exitcond.not.i, label %73, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.256.exit": ; preds = %91, %73 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %71, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %72, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %115 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %116 = tail call ptr @heap_alloc(i64 10) - %117 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %117, align 1 - br label %__barray_check_bounds.exit.i.i383 - -loop_body.preheader.i.i: ; preds = %loop_body.i386 - %"511_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 2 - %"511_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 1 - %"511_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %175, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i383: ; preds = %loop_body.i386, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" - %118 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %175, %loop_body.i386 ] - %"229_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %119, %loop_body.i386 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %115, %"__hugr__.guppylang.std.quantum.measure_array$10.256.exit" ], [ %171, %loop_body.i386 ] - %119 = add nuw nsw i64 %"229_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %118, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %118, 1 - %120 = add i64 %.fca.2.extract208.i.i, %"229_0.sroa.15.0168.i" - %121 = lshr i64 %120, 6 - %122 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %121 - %123 = load i64, ptr %122, align 4 - %124 = and i64 %120, 63 - %125 = lshr i64 %123, %124 - %126 = trunc i64 %125 to i1 - br i1 %126, label %panic.i.i.i399, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i399: ; preds = %__barray_check_bounds.exit.i.i383 +mask_block_ok.i: ; preds = %cond_exit_241 + %78 = load i64, ptr %5, align 4 + %79 = or i64 %78, -1024 + store i64 %79, ptr %5, align 4 + %80 = icmp eq i64 %79, -1 + br i1 %80, label %loop_body455.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +loop_body346.preheader: ; preds = %__barray_mask_return.exit1135, %cond_exit_241 + %"237_0.sroa.15.01197" = phi i64 [ %81, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %"237_2.01196" = phi i64 [ %89, %cond_exit_241 ], [ 0, %__barray_mask_return.exit1135 ] + %81 = add nuw nsw i64 %"237_0.sroa.15.01197", 1 + %82 = load i64, ptr %5, align 4 + %83 = lshr i64 %82, %"237_0.sroa.15.01197" + %84 = trunc i64 %83 to i1 + br i1 %84, label %panic.i1142, label %.thread + +panic.i1142: ; preds = %loop_body346.preheader tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i383 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %118, 0 - %127 = shl nuw i64 1, %124 - %128 = xor i64 %127, %123 - store i64 %128, ptr %122, align 4 - %129 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %120 - %130 = load i64, ptr %129, align 4 - tail call void @___inc_future_refcount(i64 %130) - %131 = load i64, ptr %122, align 4 - %132 = lshr i64 %131, %124 - %133 = trunc i64 %132 to i1 - br i1 %133, label %__barray_check_bounds.exit.i384, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +.thread: ; preds = %loop_body346.preheader + %85 = shl nuw nsw i64 1, %"237_0.sroa.15.01197" + %86 = xor i64 %82, %85 + store i64 %86, ptr %5, align 4 + %87 = getelementptr inbounds nuw i64, ptr %4, i64 %"237_0.sroa.15.01197" + %88 = load i64, ptr %87, align 4 + %89 = add i64 %"237_2.01196", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %88) + tail call void @___qfree(i64 %88) + %90 = icmp ult i64 %"237_2.01196", 10 + br i1 %90, label %__barray_check_bounds.exit1137, label %out_of_bounds.i1136 + +cond_exit_241: ; preds = %__barray_check_bounds.exit1137 + %91 = shl nuw nsw i64 1, %"237_2.01196" + %92 = xor i64 %75, %91 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i64, ptr %2, i64 %"237_2.01196" + store i64 %lazy_measure, ptr %93, align 4 + %94 = icmp samesign ugt i64 %"237_0.sroa.15.01197", 8 + br i1 %94, label %mask_block_ok.i, label %loop_body346.preheader + +loop_body455.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1145: ; preds = %cond_exit_307, %loop_body455.preheader.preheader + %"303_0.sroa.15.01191" = phi i64 [ %95, %cond_exit_307 ], [ 0, %loop_body455.preheader.preheader ] + %95 = add nuw nsw i64 %"303_0.sroa.15.01191", 1 + %96 = load i64, ptr %3, align 4 + %97 = lshr i64 %96, %"303_0.sroa.15.01191" + %98 = trunc i64 %97 to i1 + br i1 %98, label %panic.i1146, label %__barray_check_bounds.exit1149 + +panic.i1146: ; preds = %__barray_check_bounds.exit1145 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -cond_514_case_0.i.i: ; preds = %cond_exit_514.thread.i.i - %134 = lshr i64 %"511_1.sroa.10.0.i.i", 6 - %135 = getelementptr i64, ptr %"511_1.sroa.5.0.i.i", i64 %134 - %136 = load i64, ptr %135, align 4 - %137 = and i64 %"511_1.sroa.10.0.i.i", 63 - %138 = sub nuw nsw i64 64, %137 - %139 = lshr i64 -1, %138 - %140 = icmp eq i64 %137, 0 - %141 = select i1 %140, i64 0, i64 %139 - %142 = or i64 %136, %141 - store i64 %142, ptr %135, align 4 - %last_valid.i.i.i388 = add i64 %"511_1.sroa.10.0.i.i", 9 - %143 = lshr i64 %last_valid.i.i.i388, 6 - %144 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %143 - %145 = load i64, ptr %144, align 4 - %146 = and i64 %last_valid.i.i.i388, 63 - %147 = shl nsw i64 -2, %146 - %148 = icmp eq i64 %146, 63 - %149 = select i1 %148, i64 0, i64 %147 - %150 = or i64 %145, %149 - store i64 %150, ptr %144, align 4 - %reass.sub.i.i.i389 = sub nsw i64 %143, %134 - %.not.i.i.i390 = icmp eq i64 %reass.sub.i.i.i389, -1 - br i1 %.not.i.i.i390, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -151: ; preds = %mask_block_ok.i.i.i391 - %152 = add nuw i64 %.02.i.i.i392, 1 - %exitcond.not.i.i.i395 = icmp eq i64 %.02.i.i.i392, %reass.sub.i.i.i389 - br i1 %exitcond.not.i.i.i395, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit", label %mask_block_ok.i.i.i391 - -mask_block_ok.i.i.i391: ; preds = %cond_514_case_0.i.i, %151 - %.02.i.i.i392 = phi i64 [ %152, %151 ], [ 0, %cond_514_case_0.i.i ] - %gep.i.i.i393 = getelementptr i64, ptr %135, i64 %.02.i.i.i392 - %153 = load i64, ptr %gep.i.i.i393, align 4 - %154 = icmp eq i64 %153, -1 - br i1 %154, label %151, label %mask_block_err.i.i.i394 - -mask_block_err.i.i.i394: ; preds = %mask_block_ok.i.i.i391 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_check_bounds.exit1149: ; preds = %__barray_check_bounds.exit1145 + %99 = shl nuw nsw i64 1, %"303_0.sroa.15.01191" + %100 = xor i64 %96, %99 + store i64 %100, ptr %3, align 4 + %101 = getelementptr inbounds nuw i64, ptr %2, i64 %"303_0.sroa.15.01191" + %102 = load i64, ptr %101, align 4 + tail call void @___inc_future_refcount(i64 %102) + %103 = load i64, ptr %3, align 4 + %104 = lshr i64 %103, %"303_0.sroa.15.01191" + %105 = trunc i64 %104 to i1 + br i1 %105, label %__barray_check_bounds.exit1153, label %panic.i1150 + +panic.i1150: ; preds = %__barray_check_bounds.exit1149 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_514.thread.i.i, %loop_body.preheader.i.i - %"511_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %155, %cond_exit_514.thread.i.i ] - %155 = add nuw nsw i64 %"511_0.0239.i.i", 1 - %156 = add i64 %"511_0.0239.i.i", %"511_1.sroa.10.0.i.i" - %157 = lshr i64 %156, 6 - %158 = getelementptr inbounds nuw i64, ptr %"511_1.sroa.5.0.i.i", i64 %157 - %159 = load i64, ptr %158, align 4 - %160 = and i64 %156, 63 - %161 = lshr i64 %159, %160 - %162 = trunc i64 %161 to i1 - br i1 %162, label %cond_exit_514.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %163 = shl nuw i64 1, %160 - %164 = xor i64 %163, %159 - store i64 %164, ptr %158, align 4 - %165 = getelementptr inbounds i64, ptr %"511_1.sroa.0.0.i.i", i64 %156 - %166 = load i64, ptr %165, align 4 - tail call void @___dec_future_refcount(i64 %166) - br label %cond_exit_514.thread.i.i - -cond_exit_514.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %155, 10 - br i1 %exitcond.i.i, label %cond_514_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i384: ; preds = %__barray_check_bounds.exit221.i.i - %167 = xor i64 %131, %127 - store i64 %167, ptr %122, align 4 - store i64 %130, ptr %129, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %130) - tail call void @___dec_future_refcount(i64 %130) - %168 = load i64, ptr %117, align 4 - %169 = lshr i64 %168, %"229_0.sroa.15.0168.i" - %170 = trunc i64 %169 to i1 - br i1 %170, label %loop_body.i386, label %panic.i.i385 - -panic.i.i385: ; preds = %__barray_check_bounds.exit.i384 +__barray_check_bounds.exit1153: ; preds = %__barray_check_bounds.exit1149 + %106 = xor i64 %103, %99 + store i64 %106, ptr %3, align 4 + store i64 %102, ptr %101, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %102) + tail call void @___dec_future_refcount(i64 %102) + %107 = load i64, ptr %1, align 4 + %108 = lshr i64 %107, %"303_0.sroa.15.01191" + %109 = trunc i64 %108 to i1 + br i1 %109, label %cond_exit_307, label %panic.i1154 + +panic.i1154: ; preds = %__barray_check_bounds.exit1153 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i386: ; preds = %__barray_check_bounds.exit.i384 - %171 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %119, 1 - %172 = shl nuw nsw i64 1, %"229_0.sroa.15.0168.i" - %173 = xor i64 %168, %172 - store i64 %173, ptr %117, align 4 - %174 = getelementptr inbounds nuw i1, ptr %116, i64 %"229_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %174, align 1 - %175 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i387 = icmp eq i64 %119, 10 - br i1 %exitcond.not.i387, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i383 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit": ; preds = %151, %cond_514_case_0.i.i - tail call void @heap_free(ptr %"511_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"511_1.sroa.5.0.i.i") - %176 = load i64, ptr %117, align 4 - %177 = and i64 %176, 1023 - store i64 %177, ptr %117, align 4 - %178 = icmp eq i64 %177, 0 - br i1 %178, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" +mask_block_err.i1159: ; preds = %cond_exit_487.9 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_mask_borrow.exit1167: ; preds = %__barray_check_bounds.exit1163.preheader + %110 = or disjoint i64 %163, 1 + store i64 %110, ptr %3, align 4 + %111 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %111) + br label %cond_exit_487 + +cond_exit_487: ; preds = %__barray_mask_borrow.exit1167, %__barray_check_bounds.exit1163.preheader + %112 = load i64, ptr %3, align 4 + %113 = and i64 %112, 2 + %.not1207 = icmp eq i64 %113, 0 + br i1 %.not1207, label %__barray_mask_borrow.exit1167.1, label %cond_exit_487.1 + +__barray_mask_borrow.exit1167.1: ; preds = %cond_exit_487 + %114 = or disjoint i64 %112, 2 + store i64 %114, ptr %3, align 4 + %115 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %116 = load i64, ptr %115, align 4 + tail call void @___dec_future_refcount(i64 %116) + br label %cond_exit_487.1 + +cond_exit_487.1: ; preds = %__barray_mask_borrow.exit1167.1, %cond_exit_487 + %117 = load i64, ptr %3, align 4 + %118 = and i64 %117, 4 + %.not1208 = icmp eq i64 %118, 0 + br i1 %.not1208, label %__barray_mask_borrow.exit1167.2, label %cond_exit_487.2 + +__barray_mask_borrow.exit1167.2: ; preds = %cond_exit_487.1 + %119 = or disjoint i64 %117, 4 + store i64 %119, ptr %3, align 4 + %120 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %121 = load i64, ptr %120, align 4 + tail call void @___dec_future_refcount(i64 %121) + br label %cond_exit_487.2 + +cond_exit_487.2: ; preds = %__barray_mask_borrow.exit1167.2, %cond_exit_487.1 + %122 = load i64, ptr %3, align 4 + %123 = and i64 %122, 8 + %.not1209 = icmp eq i64 %123, 0 + br i1 %.not1209, label %__barray_mask_borrow.exit1167.3, label %cond_exit_487.3 + +__barray_mask_borrow.exit1167.3: ; preds = %cond_exit_487.2 + %124 = or disjoint i64 %122, 8 + store i64 %124, ptr %3, align 4 + %125 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %126 = load i64, ptr %125, align 4 + tail call void @___dec_future_refcount(i64 %126) + br label %cond_exit_487.3 + +cond_exit_487.3: ; preds = %__barray_mask_borrow.exit1167.3, %cond_exit_487.2 + %127 = load i64, ptr %3, align 4 + %128 = and i64 %127, 16 + %.not1210 = icmp eq i64 %128, 0 + br i1 %.not1210, label %__barray_mask_borrow.exit1167.4, label %cond_exit_487.4 + +__barray_mask_borrow.exit1167.4: ; preds = %cond_exit_487.3 + %129 = or disjoint i64 %127, 16 + store i64 %129, ptr %3, align 4 + %130 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %131 = load i64, ptr %130, align 4 + tail call void @___dec_future_refcount(i64 %131) + br label %cond_exit_487.4 + +cond_exit_487.4: ; preds = %__barray_mask_borrow.exit1167.4, %cond_exit_487.3 + %132 = load i64, ptr %3, align 4 + %133 = and i64 %132, 32 + %.not1211 = icmp eq i64 %133, 0 + br i1 %.not1211, label %__barray_mask_borrow.exit1167.5, label %cond_exit_487.5 + +__barray_mask_borrow.exit1167.5: ; preds = %cond_exit_487.4 + %134 = or disjoint i64 %132, 32 + store i64 %134, ptr %3, align 4 + %135 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %136 = load i64, ptr %135, align 4 + tail call void @___dec_future_refcount(i64 %136) + br label %cond_exit_487.5 + +cond_exit_487.5: ; preds = %__barray_mask_borrow.exit1167.5, %cond_exit_487.4 + %137 = load i64, ptr %3, align 4 + %138 = and i64 %137, 64 + %.not1212 = icmp eq i64 %138, 0 + br i1 %.not1212, label %__barray_mask_borrow.exit1167.6, label %cond_exit_487.6 + +__barray_mask_borrow.exit1167.6: ; preds = %cond_exit_487.5 + %139 = or disjoint i64 %137, 64 + store i64 %139, ptr %3, align 4 + %140 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %141 = load i64, ptr %140, align 4 + tail call void @___dec_future_refcount(i64 %141) + br label %cond_exit_487.6 + +cond_exit_487.6: ; preds = %__barray_mask_borrow.exit1167.6, %cond_exit_487.5 + %142 = load i64, ptr %3, align 4 + %143 = and i64 %142, 128 + %.not1213 = icmp eq i64 %143, 0 + br i1 %.not1213, label %__barray_mask_borrow.exit1167.7, label %cond_exit_487.7 + +__barray_mask_borrow.exit1167.7: ; preds = %cond_exit_487.6 + %144 = or disjoint i64 %142, 128 + store i64 %144, ptr %3, align 4 + %145 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %146 = load i64, ptr %145, align 4 + tail call void @___dec_future_refcount(i64 %146) + br label %cond_exit_487.7 + +cond_exit_487.7: ; preds = %__barray_mask_borrow.exit1167.7, %cond_exit_487.6 + %147 = load i64, ptr %3, align 4 + %148 = and i64 %147, 256 + %.not1214 = icmp eq i64 %148, 0 + br i1 %.not1214, label %__barray_mask_borrow.exit1167.8, label %cond_exit_487.8 + +__barray_mask_borrow.exit1167.8: ; preds = %cond_exit_487.7 + %149 = or disjoint i64 %147, 256 + store i64 %149, ptr %3, align 4 + %150 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %151 = load i64, ptr %150, align 4 + tail call void @___dec_future_refcount(i64 %151) + br label %cond_exit_487.8 + +cond_exit_487.8: ; preds = %__barray_mask_borrow.exit1167.8, %cond_exit_487.7 + %152 = load i64, ptr %3, align 4 + %153 = and i64 %152, 512 + %.not1215 = icmp eq i64 %153, 0 + br i1 %.not1215, label %__barray_mask_borrow.exit1167.9, label %cond_exit_487.9 + +__barray_mask_borrow.exit1167.9: ; preds = %cond_exit_487.8 + %154 = or disjoint i64 %152, 512 + store i64 %154, ptr %3, align 4 + %155 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %156 = load i64, ptr %155, align 4 + tail call void @___dec_future_refcount(i64 %156) + br label %cond_exit_487.9 + +cond_exit_487.9: ; preds = %__barray_mask_borrow.exit1167.9, %cond_exit_487.8 + %157 = load i64, ptr %3, align 4 + %158 = or i64 %157, -1024 + store i64 %158, ptr %3, align 4 + %159 = icmp eq i64 %158, -1 + br i1 %159, label %loop_out454, label %mask_block_err.i1159 + +cond_exit_307: ; preds = %__barray_check_bounds.exit1153 + %160 = xor i64 %107, %99 + store i64 %160, ptr %1, align 4 + %161 = getelementptr inbounds nuw i1, ptr %0, i64 %"303_0.sroa.15.01191" + store i1 %read_bool, ptr %161, align 1 + %162 = icmp eq i64 %"303_0.sroa.15.01191", 9 + br i1 %162, label %__barray_check_bounds.exit1163.preheader, label %__barray_check_bounds.exit1145 + +__barray_check_bounds.exit1163.preheader: ; preds = %cond_exit_307 + %163 = load i64, ptr %3, align 4 + %164 = trunc i64 %163 to i1 + br i1 %164, label %cond_exit_487, label %__barray_mask_borrow.exit1167 + +loop_out454: ; preds = %cond_exit_487.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %165 = load i64, ptr %1, align 4 + %166 = and i64 %165, 1023 + store i64 %166, ptr %1, align 4 + %167 = icmp eq i64 %166, 0 + br i1 %167, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1168 + +mask_block_err.i1168: ; preds = %loop_out454 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.215.exit" - %179 = tail call ptr @heap_alloc(i64 10) - %180 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %180, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %179, ptr noundef nonnull align 1 dereferenceable(10) %116, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %179) - %181 = load i64, ptr %117, align 4 - %182 = and i64 %181, 1023 - store i64 %182, ptr %117, align 4 - %183 = icmp eq i64 %182, 0 - br i1 %183, label %__barray_check_none_borrowed.exit401, label %mask_block_err.i400 - -mask_block_err.i400: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out454 + %168 = tail call ptr @heap_alloc(i64 10) + %169 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %169, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %168, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %168) + %170 = load i64, ptr %1, align 4 + %171 = and i64 %170, 1023 + store i64 %171, ptr %1, align 4 + %172 = icmp eq i64 %171, 0 + br i1 %172, label %__barray_check_none_borrowed.exit1172, label %mask_block_err.i1170 + +mask_block_err.i1170: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit401: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1172: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %184 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %184, i8 0, i64 10, i1 false) + %173 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %173, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %116, ptr %arr_ptr, align 8 - store ptr %184, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %173, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_outcomes.9CB6D2E7.0, i64 21, ptr nonnull %out_arr_alloca) ret void } @@ -576,22 +599,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr +declare i64 @___lazy_measure(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___qfree(i64) local_unnamed_addr + +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare i64 @___lazy_measure(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr -declare void @___qfree(i64) local_unnamed_addr +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-apple-darwin.ll index afe20250..3ce07d6a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-apple-darwin.ll @@ -3,830 +3,582 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_helios_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.580.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.580.exit.8, %__hugr__.__tk2_helios_qalloc.580.exit.7, %__hugr__.__tk2_helios_qalloc.580.exit.6, %__hugr__.__tk2_helios_qalloc.580.exit.5, %__hugr__.__tk2_helios_qalloc.580.exit.4, %__hugr__.__tk2_helios_qalloc.580.exit.3, %__hugr__.__tk2_helios_qalloc.580.exit.2, %__hugr__.__tk2_helios_qalloc.580.exit.1, %__hugr__.__tk2_helios_qalloc.580.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.1 - -__hugr__.__tk2_helios_qalloc.580.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.2 - -__hugr__.__tk2_helios_qalloc.580.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not851 = icmp eq i64 %10, 0 - br i1 %.not851, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.3 - -__hugr__.__tk2_helios_qalloc.580.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not852 = icmp eq i64 %14, 0 - br i1 %.not852, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.4 - -__hugr__.__tk2_helios_qalloc.580.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not853 = icmp eq i64 %18, 0 - br i1 %.not853, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.5 - -__hugr__.__tk2_helios_qalloc.580.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not854 = icmp eq i64 %22, 0 - br i1 %.not854, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.6 - -__hugr__.__tk2_helios_qalloc.580.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not855 = icmp eq i64 %26, 0 - br i1 %.not855, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.7 - -__hugr__.__tk2_helios_qalloc.580.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not856 = icmp eq i64 %30, 0 - br i1 %.not856, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.8 - -__hugr__.__tk2_helios_qalloc.580.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not857 = icmp eq i64 %34, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not858 = icmp eq i64 %38, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0842" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0842", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0842" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0842" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0842" - %48 = load i64, ptr %47, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0842" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond.not = icmp eq i64 %41, 10 - br i1 %exitcond.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit818 - %"84_0.sroa.0.0844" = phi i64 [ 0, %__barray_check_none_borrowed.exit818 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0844", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0844", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %98, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0844" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0844" - %60 = xor i64 %55, %59 - store i64 %60, ptr %98, align 4 - %61 = getelementptr inbounds nuw double, ptr %97, i64 %"84_0.sroa.0.0844" - store double %58, ptr %61, align 8 - %exitcond849.not = icmp eq i64 %53, 10 - br i1 %exitcond849.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %98, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %98, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %97, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %98, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %98, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %97, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0846" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %77, %cond_exit_131 ] - %71 = lshr i64 %"126_0.sroa.0.0846", 6 - %72 = getelementptr inbounds nuw i64, ptr %96, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0846", 63 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = add nuw nsw i64 %"126_0.sroa.0.0846", 1 - %78 = shl nuw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %95, i64 %"126_0.sroa.0.0846" - store i64 %"126_0.sroa.0.0846", ptr %80, align 4 - %exitcond850.not = icmp eq i64 %77, 100 - br i1 %exitcond850.not, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131 - %81 = getelementptr inbounds nuw i8, ptr %96, i64 8 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %82, 68719476735 - store i64 %83, ptr %81, align 4 - %84 = load i64, ptr %96, align 4 - %85 = icmp eq i64 %84, 0 - %86 = icmp eq i64 %83, 0 - %or.cond = select i1 %85, i1 %86, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %87 = call ptr @heap_alloc(i64 800) - %88 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %88, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %87, ptr noundef nonnull align 1 dereferenceable(800) %95, i64 800, i1 false) - call void @heap_free(ptr nonnull %87) - %89 = load i64, ptr %81, align 4 - %90 = and i64 %89, 68719476735 - store i64 %90, ptr %81, align 4 - %91 = load i64, ptr %96, align 4 - %92 = icmp eq i64 %91, 0 - %93 = icmp eq i64 %90, 0 - %or.cond860 = select i1 %92, i1 %93, i1 false - br i1 %or.cond860, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %94 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %94, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %95, ptr %arr_ptr299, align 8 - store ptr %94, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void - -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %95 = tail call ptr @heap_alloc(i64 800) - %96 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %96, i8 -1, i64 16, i1 false) - %97 = tail call ptr @heap_alloc(i64 80) - %98 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %98, align 1 - %99 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %100 = tail call ptr @heap_alloc(i64 80) - %101 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %101, align 1 - br label %__barray_check_bounds.exit.i.i - -102: ; preds = %loop_body.i - %103 = lshr i64 %.fca.2.extract.i.i, 6 - %104 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %.fca.2.extract.i.i, 63 - %107 = sub nuw nsw i64 64, %106 - %108 = lshr i64 -1, %107 - %109 = icmp eq i64 %106, 0 - %110 = select i1 %109, i64 0, i64 %108 - %111 = or i64 %105, %110 - store i64 %111, ptr %104, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %112 = lshr i64 %last_valid.i.i.i, 6 - %113 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %112 - %114 = load i64, ptr %113, align 4 - %115 = and i64 %last_valid.i.i.i, 63 - %116 = shl nsw i64 -2, %115 - %117 = icmp eq i64 %115, 63 - %118 = select i1 %117, i64 0, i64 %116 - %119 = or i64 %114, %118 - store i64 %119, ptr %113, align 4 - %reass.sub.i.i.i = sub nsw i64 %112, %103 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -120: ; preds = %mask_block_ok.i.i.i - %121 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %102, %120 - %.02.i.i.i = phi i64 [ %121, %120 ], [ 0, %102 ] - %gep.i.i.i = getelementptr i64, ptr %104, i64 %.02.i.i.i - %122 = load i64, ptr %gep.i.i.i, align 4 - %123 = icmp eq i64 %122, -1 - br i1 %123, label %120, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %124, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %99, %cond_exit_161 ], [ %139, %loop_body.i ] - %124 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %125 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %126 = lshr i64 %125, 6 - %127 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %126 - %128 = load i64, ptr %127, align 4 - %129 = and i64 %125, 63 - %130 = lshr i64 %128, %129 - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %132 = shl nuw i64 1, %129 - %133 = xor i64 %132, %128 - store i64 %133, ptr %127, align 4 - %134 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %125 - %135 = load i64, ptr %134, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %135) - tail call void @___qfree(i64 %135) - %136 = load i64, ptr %101, align 4 - %137 = lshr i64 %136, %"313_0.sroa.15.0178.i" - %138 = trunc i64 %137 to i1 - br i1 %138, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %139 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %124, 1 - %140 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %141 = xor i64 %136, %140 - store i64 %141, ptr %101, align 4 - %142 = getelementptr inbounds nuw i64, ptr %100, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %142, align 4 - %143 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %143, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %143, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %143, 2 - %exitcond.not.i792 = icmp eq i64 %124, 10 - br i1 %exitcond.not.i792, label %102, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %120, %102 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %100, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %101, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %144 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %145 = tail call ptr @heap_alloc(i64 10) - %146 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %146, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 0 - %147 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %148 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %147 - %149 = load i64, ptr %148, align 4 - %150 = and i64 %"627_1.sroa.10.0.i.i", 63 - %151 = lshr i64 %149, %150 - %152 = trunc i64 %151 to i1 - br i1 %152, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %153 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %295, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %154, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %144, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %291, %loop_body.i796 ] - %154 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %155 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %156 = lshr i64 %155, 6 - %157 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %156 - %158 = load i64, ptr %157, align 4 - %159 = and i64 %155, 63 - %160 = lshr i64 %158, %159 - %161 = trunc i64 %160 to i1 - br i1 %161, label %panic.i.i.i808, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i808: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %162 = shl nuw i64 1, %159 - %163 = xor i64 %162, %158 - store i64 %163, ptr %157, align 4 - %164 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %155 - %165 = load i64, ptr %164, align 4 - tail call void @___inc_future_refcount(i64 %165) - %166 = load i64, ptr %157, align 4 - %167 = lshr i64 %166, %159 - %168 = trunc i64 %167 to i1 - br i1 %168, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -169: ; preds = %mask_block_ok.i.i.i800 - %170 = add nuw i64 %.02.i.i.i801, 1 - %exitcond.not.i.i.i804 = icmp eq i64 %.02.i.i.i801, %reass.sub.i.i.i798 - br i1 %exitcond.not.i.i.i804, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -mask_block_ok.i.i.i800: ; preds = %cond_exit_630.thread.9.i.i, %169 - %.02.i.i.i801 = phi i64 [ %170, %169 ], [ 0, %cond_exit_630.thread.9.i.i ] - %gep.i.i.i802 = getelementptr i64, ptr %148, i64 %.02.i.i.i801 - %171 = load i64, ptr %gep.i.i.i802, align 4 - %172 = icmp eq i64 %171, -1 - br i1 %172, label %169, label %mask_block_err.i.i.i803 - -mask_block_err.i.i.i803: ; preds = %mask_block_ok.i.i.i800 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %173 = shl nuw i64 1, %150 - %174 = xor i64 %149, %173 - store i64 %174, ptr %148, align 4 - %175 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %"627_1.sroa.10.0.i.i" - %176 = load i64, ptr %175, align 4 - tail call void @___dec_future_refcount(i64 %176) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %177 = add i64 %"627_1.sroa.10.0.i.i", 1 - %178 = lshr i64 %177, 6 - %179 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %178 - %180 = load i64, ptr %179, align 4 - %181 = and i64 %177, 63 - %182 = lshr i64 %180, %181 - %183 = trunc i64 %182 to i1 - br i1 %183, label %cond_exit_630.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_630.thread.i.i - %184 = shl nuw i64 1, %181 - %185 = xor i64 %180, %184 - store i64 %185, ptr %179, align 4 - %186 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %177 - %187 = load i64, ptr %186, align 4 - tail call void @___dec_future_refcount(i64 %187) - br label %cond_exit_630.thread.1.i.i - -cond_exit_630.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_630.thread.i.i - %188 = add i64 %"627_1.sroa.10.0.i.i", 2 - %189 = lshr i64 %188, 6 - %190 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %189 - %191 = load i64, ptr %190, align 4 - %192 = and i64 %188, 63 - %193 = lshr i64 %191, %192 - %194 = trunc i64 %193 to i1 - br i1 %194, label %cond_exit_630.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_630.thread.1.i.i - %195 = shl nuw i64 1, %192 - %196 = xor i64 %191, %195 - store i64 %196, ptr %190, align 4 - %197 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %188 - %198 = load i64, ptr %197, align 4 - tail call void @___dec_future_refcount(i64 %198) - br label %cond_exit_630.thread.2.i.i - -cond_exit_630.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_630.thread.1.i.i - %199 = add i64 %"627_1.sroa.10.0.i.i", 3 - %200 = lshr i64 %199, 6 - %201 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %200 - %202 = load i64, ptr %201, align 4 - %203 = and i64 %199, 63 - %204 = lshr i64 %202, %203 - %205 = trunc i64 %204 to i1 - br i1 %205, label %cond_exit_630.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_630.thread.2.i.i - %206 = shl nuw i64 1, %203 - %207 = xor i64 %202, %206 - store i64 %207, ptr %201, align 4 - %208 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %199 - %209 = load i64, ptr %208, align 4 - tail call void @___dec_future_refcount(i64 %209) - br label %cond_exit_630.thread.3.i.i - -cond_exit_630.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_630.thread.2.i.i - %210 = add i64 %"627_1.sroa.10.0.i.i", 4 - %211 = lshr i64 %210, 6 - %212 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %211 - %213 = load i64, ptr %212, align 4 - %214 = and i64 %210, 63 - %215 = lshr i64 %213, %214 - %216 = trunc i64 %215 to i1 - br i1 %216, label %cond_exit_630.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_630.thread.3.i.i - %217 = shl nuw i64 1, %214 - %218 = xor i64 %213, %217 - store i64 %218, ptr %212, align 4 - %219 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %210 - %220 = load i64, ptr %219, align 4 - tail call void @___dec_future_refcount(i64 %220) - br label %cond_exit_630.thread.4.i.i - -cond_exit_630.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_630.thread.3.i.i - %221 = add i64 %"627_1.sroa.10.0.i.i", 5 - %222 = lshr i64 %221, 6 - %223 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %222 - %224 = load i64, ptr %223, align 4 - %225 = and i64 %221, 63 - %226 = lshr i64 %224, %225 - %227 = trunc i64 %226 to i1 - br i1 %227, label %cond_exit_630.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_630.thread.4.i.i - %228 = shl nuw i64 1, %225 - %229 = xor i64 %224, %228 - store i64 %229, ptr %223, align 4 - %230 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %221 - %231 = load i64, ptr %230, align 4 - tail call void @___dec_future_refcount(i64 %231) - br label %cond_exit_630.thread.5.i.i - -cond_exit_630.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_630.thread.4.i.i - %232 = add i64 %"627_1.sroa.10.0.i.i", 6 - %233 = lshr i64 %232, 6 - %234 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %233 - %235 = load i64, ptr %234, align 4 - %236 = and i64 %232, 63 - %237 = lshr i64 %235, %236 - %238 = trunc i64 %237 to i1 - br i1 %238, label %cond_exit_630.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_630.thread.5.i.i - %239 = shl nuw i64 1, %236 - %240 = xor i64 %235, %239 - store i64 %240, ptr %234, align 4 - %241 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %232 - %242 = load i64, ptr %241, align 4 - tail call void @___dec_future_refcount(i64 %242) - br label %cond_exit_630.thread.6.i.i - -cond_exit_630.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_630.thread.5.i.i - %243 = add i64 %"627_1.sroa.10.0.i.i", 7 - %244 = lshr i64 %243, 6 - %245 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %244 - %246 = load i64, ptr %245, align 4 - %247 = and i64 %243, 63 - %248 = lshr i64 %246, %247 - %249 = trunc i64 %248 to i1 - br i1 %249, label %cond_exit_630.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_630.thread.6.i.i - %250 = shl nuw i64 1, %247 - %251 = xor i64 %246, %250 - store i64 %251, ptr %245, align 4 - %252 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %243 - %253 = load i64, ptr %252, align 4 - tail call void @___dec_future_refcount(i64 %253) - br label %cond_exit_630.thread.7.i.i - -cond_exit_630.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_630.thread.6.i.i - %254 = add i64 %"627_1.sroa.10.0.i.i", 8 - %255 = lshr i64 %254, 6 - %256 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %255 - %257 = load i64, ptr %256, align 4 - %258 = and i64 %254, 63 - %259 = lshr i64 %257, %258 - %260 = trunc i64 %259 to i1 - br i1 %260, label %cond_exit_630.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_630.thread.7.i.i - %261 = shl nuw i64 1, %258 - %262 = xor i64 %257, %261 - store i64 %262, ptr %256, align 4 - %263 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %254 - %264 = load i64, ptr %263, align 4 - tail call void @___dec_future_refcount(i64 %264) - br label %cond_exit_630.thread.8.i.i - -cond_exit_630.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_630.thread.7.i.i - %265 = add i64 %"627_1.sroa.10.0.i.i", 9 - %266 = lshr i64 %265, 6 - %267 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %266 - %268 = load i64, ptr %267, align 4 - %269 = and i64 %265, 63 - %270 = lshr i64 %268, %269 - %271 = trunc i64 %270 to i1 - br i1 %271, label %cond_exit_630.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_630.thread.8.i.i - %272 = shl nuw i64 1, %269 - %273 = xor i64 %268, %272 - store i64 %273, ptr %267, align 4 - %274 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %265 - %275 = load i64, ptr %274, align 4 - tail call void @___dec_future_refcount(i64 %275) - br label %cond_exit_630.thread.9.i.i - -cond_exit_630.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_630.thread.8.i.i - %276 = load i64, ptr %148, align 4 - %277 = sub nuw nsw i64 64, %150 - %278 = lshr i64 -1, %277 - %279 = icmp eq i64 %150, 0 - %280 = select i1 %279, i64 0, i64 %278 - %281 = or i64 %276, %280 - store i64 %281, ptr %148, align 4 - %282 = load i64, ptr %267, align 4 - %283 = shl nsw i64 -2, %269 - %284 = icmp eq i64 %269, 63 - %285 = select i1 %284, i64 0, i64 %283 - %286 = or i64 %282, %285 - store i64 %286, ptr %267, align 4 - %reass.sub.i.i.i798 = sub nsw i64 %266, %147 - %.not.i.i.i799 = icmp eq i64 %reass.sub.i.i.i798, -1 - br i1 %.not.i.i.i799, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %287 = xor i64 %166, %162 - store i64 %287, ptr %157, align 4 - store i64 %165, ptr %164, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %165) - tail call void @___dec_future_refcount(i64 %165) - %288 = load i64, ptr %146, align 4 - %289 = lshr i64 %288, %"354_0.sroa.15.0168.i" - %290 = trunc i64 %289 to i1 - br i1 %290, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %291 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %154, 1 - %292 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %293 = xor i64 %288, %292 - store i64 %293, ptr %146, align 4 - %294 = getelementptr inbounds nuw i1, ptr %145, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %294, align 1 - %295 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %154, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %169, %cond_exit_630.thread.9.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %296 = load i64, ptr %146, align 4 - %297 = and i64 %296, 1023 - store i64 %297, ptr %146, align 4 - %298 = icmp eq i64 %297, 0 - br i1 %298, label %__barray_check_none_borrowed.exit813, label %mask_block_err.i811 - -__barray_check_none_borrowed.exit813: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %299 = tail call ptr @heap_alloc(i64 10) - %300 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %300, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %299, ptr noundef nonnull align 1 dereferenceable(10) %145, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %299) - %301 = load i64, ptr %146, align 4 - %302 = and i64 %301, 1023 - store i64 %302, ptr %146, align 4 - %303 = icmp eq i64 %302, 0 - br i1 %303, label %__barray_check_none_borrowed.exit818, label %mask_block_err.i816 - -mask_block_err.i811: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit818: ; preds = %__barray_check_none_borrowed.exit813 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %304 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %304, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %145, ptr %arr_ptr, align 8 - store ptr %304, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i816: ; preds = %__barray_check_none_borrowed.exit813 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %156, %cond_exit_366 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 63 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = add nuw nsw i64 %"362_2.01892", 1 + %157 = shl nuw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %exitcond1897 = icmp eq i64 %156, 100 + br i1 %exitcond1897, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366 + %160 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %161 = load i64, ptr %160, align 4 + %162 = and i64 %161, 68719476735 + store i64 %162, ptr %160, align 4 + %163 = load i64, ptr %5, align 4 + %164 = icmp eq i64 %163, 0 + %165 = icmp eq i64 %162, 0 + %or.cond = select i1 %164, i1 %165, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %166 = call ptr @heap_alloc(i64 800) + %167 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %167, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %166, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %166) + %168 = load i64, ptr %160, align 4 + %169 = and i64 %168, 68719476735 + store i64 %169, ptr %160, align 4 + %170 = load i64, ptr %5, align 4 + %171 = icmp eq i64 %170, 0 + %172 = icmp eq i64 %169, 0 + %or.cond1902 = select i1 %171, i1 %172, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %173 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %173, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %173, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -837,26 +589,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-unknown-linux-gnu.ll index fc4df603..af2618f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-aarch64-unknown-linux-gnu.ll @@ -3,830 +3,582 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_helios_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.580.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.580.exit.8, %__hugr__.__tk2_helios_qalloc.580.exit.7, %__hugr__.__tk2_helios_qalloc.580.exit.6, %__hugr__.__tk2_helios_qalloc.580.exit.5, %__hugr__.__tk2_helios_qalloc.580.exit.4, %__hugr__.__tk2_helios_qalloc.580.exit.3, %__hugr__.__tk2_helios_qalloc.580.exit.2, %__hugr__.__tk2_helios_qalloc.580.exit.1, %__hugr__.__tk2_helios_qalloc.580.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.1 - -__hugr__.__tk2_helios_qalloc.580.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.2 - -__hugr__.__tk2_helios_qalloc.580.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not851 = icmp eq i64 %10, 0 - br i1 %.not851, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.3 - -__hugr__.__tk2_helios_qalloc.580.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not852 = icmp eq i64 %14, 0 - br i1 %.not852, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.4 - -__hugr__.__tk2_helios_qalloc.580.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not853 = icmp eq i64 %18, 0 - br i1 %.not853, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.5 - -__hugr__.__tk2_helios_qalloc.580.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not854 = icmp eq i64 %22, 0 - br i1 %.not854, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.6 - -__hugr__.__tk2_helios_qalloc.580.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not855 = icmp eq i64 %26, 0 - br i1 %.not855, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.7 - -__hugr__.__tk2_helios_qalloc.580.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not856 = icmp eq i64 %30, 0 - br i1 %.not856, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__hugr__.__tk2_helios_qalloc.580.exit.8 - -__hugr__.__tk2_helios_qalloc.580.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not857 = icmp eq i64 %34, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.580.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not858 = icmp eq i64 %38, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0842" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0842", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0842" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0842" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0842" - %48 = load i64, ptr %47, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0842" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond.not = icmp eq i64 %41, 10 - br i1 %exitcond.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit818 - %"84_0.sroa.0.0844" = phi i64 [ 0, %__barray_check_none_borrowed.exit818 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0844", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0844", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %98, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0844" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0844" - %60 = xor i64 %55, %59 - store i64 %60, ptr %98, align 4 - %61 = getelementptr inbounds nuw double, ptr %97, i64 %"84_0.sroa.0.0844" - store double %58, ptr %61, align 8 - %exitcond849.not = icmp eq i64 %53, 10 - br i1 %exitcond849.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %98, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %98, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %97, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %98, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %98, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %97, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0846" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %77, %cond_exit_131 ] - %71 = lshr i64 %"126_0.sroa.0.0846", 6 - %72 = getelementptr inbounds nuw i64, ptr %96, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0846", 63 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = add nuw nsw i64 %"126_0.sroa.0.0846", 1 - %78 = shl nuw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %95, i64 %"126_0.sroa.0.0846" - store i64 %"126_0.sroa.0.0846", ptr %80, align 4 - %exitcond850.not = icmp eq i64 %77, 100 - br i1 %exitcond850.not, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131 - %81 = getelementptr inbounds nuw i8, ptr %96, i64 8 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %82, 68719476735 - store i64 %83, ptr %81, align 4 - %84 = load i64, ptr %96, align 4 - %85 = icmp eq i64 %84, 0 - %86 = icmp eq i64 %83, 0 - %or.cond = select i1 %85, i1 %86, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %87 = call ptr @heap_alloc(i64 800) - %88 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %88, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %87, ptr noundef nonnull align 1 dereferenceable(800) %95, i64 800, i1 false) - call void @heap_free(ptr nonnull %87) - %89 = load i64, ptr %81, align 4 - %90 = and i64 %89, 68719476735 - store i64 %90, ptr %81, align 4 - %91 = load i64, ptr %96, align 4 - %92 = icmp eq i64 %91, 0 - %93 = icmp eq i64 %90, 0 - %or.cond860 = select i1 %92, i1 %93, i1 false - br i1 %or.cond860, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %94 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %94, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %95, ptr %arr_ptr299, align 8 - store ptr %94, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void - -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %95 = tail call ptr @heap_alloc(i64 800) - %96 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %96, i8 -1, i64 16, i1 false) - %97 = tail call ptr @heap_alloc(i64 80) - %98 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %98, align 1 - %99 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %100 = tail call ptr @heap_alloc(i64 80) - %101 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %101, align 1 - br label %__barray_check_bounds.exit.i.i - -102: ; preds = %loop_body.i - %103 = lshr i64 %.fca.2.extract.i.i, 6 - %104 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %.fca.2.extract.i.i, 63 - %107 = sub nuw nsw i64 64, %106 - %108 = lshr i64 -1, %107 - %109 = icmp eq i64 %106, 0 - %110 = select i1 %109, i64 0, i64 %108 - %111 = or i64 %105, %110 - store i64 %111, ptr %104, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %112 = lshr i64 %last_valid.i.i.i, 6 - %113 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %112 - %114 = load i64, ptr %113, align 4 - %115 = and i64 %last_valid.i.i.i, 63 - %116 = shl nsw i64 -2, %115 - %117 = icmp eq i64 %115, 63 - %118 = select i1 %117, i64 0, i64 %116 - %119 = or i64 %114, %118 - store i64 %119, ptr %113, align 4 - %reass.sub.i.i.i = sub nsw i64 %112, %103 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -120: ; preds = %mask_block_ok.i.i.i - %121 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %102, %120 - %.02.i.i.i = phi i64 [ %121, %120 ], [ 0, %102 ] - %gep.i.i.i = getelementptr i64, ptr %104, i64 %.02.i.i.i - %122 = load i64, ptr %gep.i.i.i, align 4 - %123 = icmp eq i64 %122, -1 - br i1 %123, label %120, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %124, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %99, %cond_exit_161 ], [ %139, %loop_body.i ] - %124 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %125 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %126 = lshr i64 %125, 6 - %127 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %126 - %128 = load i64, ptr %127, align 4 - %129 = and i64 %125, 63 - %130 = lshr i64 %128, %129 - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %132 = shl nuw i64 1, %129 - %133 = xor i64 %132, %128 - store i64 %133, ptr %127, align 4 - %134 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %125 - %135 = load i64, ptr %134, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %135) - tail call void @___qfree(i64 %135) - %136 = load i64, ptr %101, align 4 - %137 = lshr i64 %136, %"313_0.sroa.15.0178.i" - %138 = trunc i64 %137 to i1 - br i1 %138, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %139 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %124, 1 - %140 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %141 = xor i64 %136, %140 - store i64 %141, ptr %101, align 4 - %142 = getelementptr inbounds nuw i64, ptr %100, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %142, align 4 - %143 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %143, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %143, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %143, 2 - %exitcond.not.i792 = icmp eq i64 %124, 10 - br i1 %exitcond.not.i792, label %102, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %120, %102 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %100, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %101, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %144 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %145 = tail call ptr @heap_alloc(i64 10) - %146 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %146, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 0 - %147 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %148 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %147 - %149 = load i64, ptr %148, align 4 - %150 = and i64 %"627_1.sroa.10.0.i.i", 63 - %151 = lshr i64 %149, %150 - %152 = trunc i64 %151 to i1 - br i1 %152, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %153 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %295, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %154, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %144, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %291, %loop_body.i796 ] - %154 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %155 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %156 = lshr i64 %155, 6 - %157 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %156 - %158 = load i64, ptr %157, align 4 - %159 = and i64 %155, 63 - %160 = lshr i64 %158, %159 - %161 = trunc i64 %160 to i1 - br i1 %161, label %panic.i.i.i808, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i808: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %162 = shl nuw i64 1, %159 - %163 = xor i64 %162, %158 - store i64 %163, ptr %157, align 4 - %164 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %155 - %165 = load i64, ptr %164, align 4 - tail call void @___inc_future_refcount(i64 %165) - %166 = load i64, ptr %157, align 4 - %167 = lshr i64 %166, %159 - %168 = trunc i64 %167 to i1 - br i1 %168, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -169: ; preds = %mask_block_ok.i.i.i800 - %170 = add nuw i64 %.02.i.i.i801, 1 - %exitcond.not.i.i.i804 = icmp eq i64 %.02.i.i.i801, %reass.sub.i.i.i798 - br i1 %exitcond.not.i.i.i804, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -mask_block_ok.i.i.i800: ; preds = %cond_exit_630.thread.9.i.i, %169 - %.02.i.i.i801 = phi i64 [ %170, %169 ], [ 0, %cond_exit_630.thread.9.i.i ] - %gep.i.i.i802 = getelementptr i64, ptr %148, i64 %.02.i.i.i801 - %171 = load i64, ptr %gep.i.i.i802, align 4 - %172 = icmp eq i64 %171, -1 - br i1 %172, label %169, label %mask_block_err.i.i.i803 - -mask_block_err.i.i.i803: ; preds = %mask_block_ok.i.i.i800 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %173 = shl nuw i64 1, %150 - %174 = xor i64 %149, %173 - store i64 %174, ptr %148, align 4 - %175 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %"627_1.sroa.10.0.i.i" - %176 = load i64, ptr %175, align 4 - tail call void @___dec_future_refcount(i64 %176) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %177 = add i64 %"627_1.sroa.10.0.i.i", 1 - %178 = lshr i64 %177, 6 - %179 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %178 - %180 = load i64, ptr %179, align 4 - %181 = and i64 %177, 63 - %182 = lshr i64 %180, %181 - %183 = trunc i64 %182 to i1 - br i1 %183, label %cond_exit_630.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_630.thread.i.i - %184 = shl nuw i64 1, %181 - %185 = xor i64 %180, %184 - store i64 %185, ptr %179, align 4 - %186 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %177 - %187 = load i64, ptr %186, align 4 - tail call void @___dec_future_refcount(i64 %187) - br label %cond_exit_630.thread.1.i.i - -cond_exit_630.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_630.thread.i.i - %188 = add i64 %"627_1.sroa.10.0.i.i", 2 - %189 = lshr i64 %188, 6 - %190 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %189 - %191 = load i64, ptr %190, align 4 - %192 = and i64 %188, 63 - %193 = lshr i64 %191, %192 - %194 = trunc i64 %193 to i1 - br i1 %194, label %cond_exit_630.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_630.thread.1.i.i - %195 = shl nuw i64 1, %192 - %196 = xor i64 %191, %195 - store i64 %196, ptr %190, align 4 - %197 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %188 - %198 = load i64, ptr %197, align 4 - tail call void @___dec_future_refcount(i64 %198) - br label %cond_exit_630.thread.2.i.i - -cond_exit_630.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_630.thread.1.i.i - %199 = add i64 %"627_1.sroa.10.0.i.i", 3 - %200 = lshr i64 %199, 6 - %201 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %200 - %202 = load i64, ptr %201, align 4 - %203 = and i64 %199, 63 - %204 = lshr i64 %202, %203 - %205 = trunc i64 %204 to i1 - br i1 %205, label %cond_exit_630.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_630.thread.2.i.i - %206 = shl nuw i64 1, %203 - %207 = xor i64 %202, %206 - store i64 %207, ptr %201, align 4 - %208 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %199 - %209 = load i64, ptr %208, align 4 - tail call void @___dec_future_refcount(i64 %209) - br label %cond_exit_630.thread.3.i.i - -cond_exit_630.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_630.thread.2.i.i - %210 = add i64 %"627_1.sroa.10.0.i.i", 4 - %211 = lshr i64 %210, 6 - %212 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %211 - %213 = load i64, ptr %212, align 4 - %214 = and i64 %210, 63 - %215 = lshr i64 %213, %214 - %216 = trunc i64 %215 to i1 - br i1 %216, label %cond_exit_630.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_630.thread.3.i.i - %217 = shl nuw i64 1, %214 - %218 = xor i64 %213, %217 - store i64 %218, ptr %212, align 4 - %219 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %210 - %220 = load i64, ptr %219, align 4 - tail call void @___dec_future_refcount(i64 %220) - br label %cond_exit_630.thread.4.i.i - -cond_exit_630.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_630.thread.3.i.i - %221 = add i64 %"627_1.sroa.10.0.i.i", 5 - %222 = lshr i64 %221, 6 - %223 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %222 - %224 = load i64, ptr %223, align 4 - %225 = and i64 %221, 63 - %226 = lshr i64 %224, %225 - %227 = trunc i64 %226 to i1 - br i1 %227, label %cond_exit_630.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_630.thread.4.i.i - %228 = shl nuw i64 1, %225 - %229 = xor i64 %224, %228 - store i64 %229, ptr %223, align 4 - %230 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %221 - %231 = load i64, ptr %230, align 4 - tail call void @___dec_future_refcount(i64 %231) - br label %cond_exit_630.thread.5.i.i - -cond_exit_630.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_630.thread.4.i.i - %232 = add i64 %"627_1.sroa.10.0.i.i", 6 - %233 = lshr i64 %232, 6 - %234 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %233 - %235 = load i64, ptr %234, align 4 - %236 = and i64 %232, 63 - %237 = lshr i64 %235, %236 - %238 = trunc i64 %237 to i1 - br i1 %238, label %cond_exit_630.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_630.thread.5.i.i - %239 = shl nuw i64 1, %236 - %240 = xor i64 %235, %239 - store i64 %240, ptr %234, align 4 - %241 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %232 - %242 = load i64, ptr %241, align 4 - tail call void @___dec_future_refcount(i64 %242) - br label %cond_exit_630.thread.6.i.i - -cond_exit_630.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_630.thread.5.i.i - %243 = add i64 %"627_1.sroa.10.0.i.i", 7 - %244 = lshr i64 %243, 6 - %245 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %244 - %246 = load i64, ptr %245, align 4 - %247 = and i64 %243, 63 - %248 = lshr i64 %246, %247 - %249 = trunc i64 %248 to i1 - br i1 %249, label %cond_exit_630.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_630.thread.6.i.i - %250 = shl nuw i64 1, %247 - %251 = xor i64 %246, %250 - store i64 %251, ptr %245, align 4 - %252 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %243 - %253 = load i64, ptr %252, align 4 - tail call void @___dec_future_refcount(i64 %253) - br label %cond_exit_630.thread.7.i.i - -cond_exit_630.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_630.thread.6.i.i - %254 = add i64 %"627_1.sroa.10.0.i.i", 8 - %255 = lshr i64 %254, 6 - %256 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %255 - %257 = load i64, ptr %256, align 4 - %258 = and i64 %254, 63 - %259 = lshr i64 %257, %258 - %260 = trunc i64 %259 to i1 - br i1 %260, label %cond_exit_630.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_630.thread.7.i.i - %261 = shl nuw i64 1, %258 - %262 = xor i64 %257, %261 - store i64 %262, ptr %256, align 4 - %263 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %254 - %264 = load i64, ptr %263, align 4 - tail call void @___dec_future_refcount(i64 %264) - br label %cond_exit_630.thread.8.i.i - -cond_exit_630.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_630.thread.7.i.i - %265 = add i64 %"627_1.sroa.10.0.i.i", 9 - %266 = lshr i64 %265, 6 - %267 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %266 - %268 = load i64, ptr %267, align 4 - %269 = and i64 %265, 63 - %270 = lshr i64 %268, %269 - %271 = trunc i64 %270 to i1 - br i1 %271, label %cond_exit_630.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_630.thread.8.i.i - %272 = shl nuw i64 1, %269 - %273 = xor i64 %268, %272 - store i64 %273, ptr %267, align 4 - %274 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %265 - %275 = load i64, ptr %274, align 4 - tail call void @___dec_future_refcount(i64 %275) - br label %cond_exit_630.thread.9.i.i - -cond_exit_630.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_630.thread.8.i.i - %276 = load i64, ptr %148, align 4 - %277 = sub nuw nsw i64 64, %150 - %278 = lshr i64 -1, %277 - %279 = icmp eq i64 %150, 0 - %280 = select i1 %279, i64 0, i64 %278 - %281 = or i64 %276, %280 - store i64 %281, ptr %148, align 4 - %282 = load i64, ptr %267, align 4 - %283 = shl nsw i64 -2, %269 - %284 = icmp eq i64 %269, 63 - %285 = select i1 %284, i64 0, i64 %283 - %286 = or i64 %282, %285 - store i64 %286, ptr %267, align 4 - %reass.sub.i.i.i798 = sub nsw i64 %266, %147 - %.not.i.i.i799 = icmp eq i64 %reass.sub.i.i.i798, -1 - br i1 %.not.i.i.i799, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %287 = xor i64 %166, %162 - store i64 %287, ptr %157, align 4 - store i64 %165, ptr %164, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %165) - tail call void @___dec_future_refcount(i64 %165) - %288 = load i64, ptr %146, align 4 - %289 = lshr i64 %288, %"354_0.sroa.15.0168.i" - %290 = trunc i64 %289 to i1 - br i1 %290, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %291 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %154, 1 - %292 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %293 = xor i64 %288, %292 - store i64 %293, ptr %146, align 4 - %294 = getelementptr inbounds nuw i1, ptr %145, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %294, align 1 - %295 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %154, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %169, %cond_exit_630.thread.9.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %296 = load i64, ptr %146, align 4 - %297 = and i64 %296, 1023 - store i64 %297, ptr %146, align 4 - %298 = icmp eq i64 %297, 0 - br i1 %298, label %__barray_check_none_borrowed.exit813, label %mask_block_err.i811 - -__barray_check_none_borrowed.exit813: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %299 = tail call ptr @heap_alloc(i64 10) - %300 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %300, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %299, ptr noundef nonnull align 1 dereferenceable(10) %145, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %299) - %301 = load i64, ptr %146, align 4 - %302 = and i64 %301, 1023 - store i64 %302, ptr %146, align 4 - %303 = icmp eq i64 %302, 0 - br i1 %303, label %__barray_check_none_borrowed.exit818, label %mask_block_err.i816 - -mask_block_err.i811: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit818: ; preds = %__barray_check_none_borrowed.exit813 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %304 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %304, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %145, ptr %arr_ptr, align 8 - store ptr %304, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i816: ; preds = %__barray_check_none_borrowed.exit813 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %156, %cond_exit_366 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 63 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = add nuw nsw i64 %"362_2.01892", 1 + %157 = shl nuw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %exitcond1897 = icmp eq i64 %156, 100 + br i1 %exitcond1897, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366 + %160 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %161 = load i64, ptr %160, align 4 + %162 = and i64 %161, 68719476735 + store i64 %162, ptr %160, align 4 + %163 = load i64, ptr %5, align 4 + %164 = icmp eq i64 %163, 0 + %165 = icmp eq i64 %162, 0 + %or.cond = select i1 %164, i1 %165, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %166 = call ptr @heap_alloc(i64 800) + %167 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %167, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %166, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %166) + %168 = load i64, ptr %160, align 4 + %169 = and i64 %168, 68719476735 + store i64 %169, ptr %160, align 4 + %170 = load i64, ptr %5, align 4 + %171 = icmp eq i64 %170, 0 + %172 = icmp eq i64 %169, 0 + %or.cond1902 = select i1 %171, i1 %172, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %173 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %173, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %173, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -837,26 +589,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-apple-darwin.ll index c7cf9220..5ae50b69 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-apple-darwin.ll @@ -3,691 +3,597 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_helios_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__barray_check_bounds.exit.2 - -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not857 = icmp eq i64 %10, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__barray_check_bounds.exit.3 - -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not858 = icmp eq i64 %14, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__barray_check_bounds.exit.4 - -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not859 = icmp eq i64 %18, 0 - br i1 %.not859, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__barray_check_bounds.exit.5 - -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not860 = icmp eq i64 %22, 0 - br i1 %.not860, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__barray_check_bounds.exit.6 - -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not861 = icmp eq i64 %26, 0 - br i1 %.not861, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not862 = icmp eq i64 %30, 0 - br i1 %.not862, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__barray_check_bounds.exit.8 - -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not863 = icmp eq i64 %34, 0 - br i1 %.not863, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not864 = icmp eq i64 %38, 0 - br i1 %.not864, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0843" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0843", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0843" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0843" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0843" - %48 = load i64, ptr %47, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0843" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond850.not = icmp eq i64 %41, 10 - br i1 %exitcond850.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit819 - %"84_0.sroa.0.0845" = phi i64 [ 0, %__barray_check_none_borrowed.exit819 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0845", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0845", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %108, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0845" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0845" - %60 = xor i64 %55, %59 - store i64 %60, ptr %108, align 4 - %61 = getelementptr inbounds nuw double, ptr %107, i64 %"84_0.sroa.0.0845" - store double %58, ptr %61, align 8 - %exitcond851.not = icmp eq i64 %53, 10 - br i1 %exitcond851.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %108, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %108, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %107, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %108, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %108, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %107, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131.1, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0847" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %87, %cond_exit_131.1 ] - %71 = lshr i64 %"126_0.sroa.0.0847", 6 - %72 = getelementptr inbounds nuw i64, ptr %106, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0847", 62 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %cond_exit_131, %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = or disjoint i64 %"126_0.sroa.0.0847", 1 - %78 = shl nuw nsw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %105, i64 %"126_0.sroa.0.0847" - store i64 %"126_0.sroa.0.0847", ptr %80, align 4 - %81 = lshr i64 %"126_0.sroa.0.0847", 6 - %82 = getelementptr inbounds nuw i64, ptr %106, i64 %81 - %83 = load i64, ptr %82, align 4 - %84 = and i64 %77, 63 - %85 = lshr i64 %83, %84 - %86 = trunc i64 %85 to i1 - br i1 %86, label %cond_exit_131.1, label %panic.i780 - -cond_exit_131.1: ; preds = %cond_exit_131 - %87 = add nuw nsw i64 %"126_0.sroa.0.0847", 2 - %88 = shl nuw i64 1, %84 - %89 = xor i64 %83, %88 - store i64 %89, ptr %82, align 4 - %90 = getelementptr inbounds nuw i64, ptr %105, i64 %77 - store i64 %77, ptr %90, align 4 - %exitcond852.not.1 = icmp eq i64 %87, 100 - br i1 %exitcond852.not.1, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131.1 - %91 = getelementptr inbounds nuw i8, ptr %106, i64 8 - %92 = load i64, ptr %91, align 4 - %93 = and i64 %92, 68719476735 - store i64 %93, ptr %91, align 4 - %94 = load i64, ptr %106, align 4 - %95 = icmp eq i64 %94, 0 - %96 = icmp eq i64 %93, 0 - %or.cond = select i1 %95, i1 %96, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %97 = call ptr @heap_alloc(i64 800) - %98 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %98, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %97, ptr noundef nonnull align 1 dereferenceable(800) %105, i64 800, i1 false) - call void @heap_free(ptr nonnull %97) - %99 = load i64, ptr %91, align 4 - %100 = and i64 %99, 68719476735 - store i64 %100, ptr %91, align 4 - %101 = load i64, ptr %106, align 4 - %102 = icmp eq i64 %101, 0 - %103 = icmp eq i64 %100, 0 - %or.cond854 = select i1 %102, i1 %103, i1 false - br i1 %or.cond854, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %104 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %104, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %105, ptr %arr_ptr299, align 8 - store ptr %104, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %105 = tail call ptr @heap_alloc(i64 800) - %106 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %106, i8 -1, i64 16, i1 false) - %107 = tail call ptr @heap_alloc(i64 80) - %108 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %108, align 1 - %109 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %110 = tail call ptr @heap_alloc(i64 80) - %111 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %111, align 1 - br label %__barray_check_bounds.exit.i.i - -112: ; preds = %loop_body.i - %113 = lshr i64 %.fca.2.extract.i.i, 6 - %114 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %113 - %115 = load i64, ptr %114, align 4 - %116 = and i64 %.fca.2.extract.i.i, 63 - %117 = sub nuw nsw i64 64, %116 - %118 = lshr i64 -1, %117 - %119 = icmp eq i64 %116, 0 - %120 = select i1 %119, i64 0, i64 %118 - %121 = or i64 %115, %120 - store i64 %121, ptr %114, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %122 = lshr i64 %last_valid.i.i.i, 6 - %123 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %122 - %124 = load i64, ptr %123, align 4 - %125 = and i64 %last_valid.i.i.i, 63 - %126 = shl nsw i64 -2, %125 - %127 = icmp eq i64 %125, 63 - %128 = select i1 %127, i64 0, i64 %126 - %129 = or i64 %124, %128 - store i64 %129, ptr %123, align 4 - %reass.sub.i.i.i = sub nsw i64 %122, %113 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -130: ; preds = %mask_block_ok.i.i.i - %131 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %112, %130 - %.02.i.i.i = phi i64 [ %131, %130 ], [ 0, %112 ] - %gep.i.i.i = getelementptr i64, ptr %114, i64 %.02.i.i.i - %132 = load i64, ptr %gep.i.i.i, align 4 - %133 = icmp eq i64 %132, -1 - br i1 %133, label %130, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %134, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %109, %cond_exit_161 ], [ %149, %loop_body.i ] - %134 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %135 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %136 = lshr i64 %135, 6 - %137 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %136 - %138 = load i64, ptr %137, align 4 - %139 = and i64 %135, 63 - %140 = lshr i64 %138, %139 - %141 = trunc i64 %140 to i1 - br i1 %141, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %142 = shl nuw i64 1, %139 - %143 = xor i64 %142, %138 - store i64 %143, ptr %137, align 4 - %144 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %135 - %145 = load i64, ptr %144, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %145) - tail call void @___qfree(i64 %145) - %146 = load i64, ptr %111, align 4 - %147 = lshr i64 %146, %"313_0.sroa.15.0178.i" - %148 = trunc i64 %147 to i1 - br i1 %148, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %149 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %134, 1 - %150 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %151 = xor i64 %146, %150 - store i64 %151, ptr %111, align 4 - %152 = getelementptr inbounds nuw i64, ptr %110, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %152, align 4 - %153 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %exitcond.not.i792 = icmp eq i64 %134, 10 - br i1 %exitcond.not.i792, label %112, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %130, %112 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %110, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %111, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %154 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %155 = tail call ptr @heap_alloc(i64 10) - %156 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %156, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %157 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %214, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %158, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %154, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %210, %loop_body.i796 ] - %158 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %157, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %157, 1 - %159 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %panic.i.i.i809, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i809: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %157, 0 - %166 = shl nuw i64 1, %163 - %167 = xor i64 %166, %162 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___inc_future_refcount(i64 %169) - %170 = load i64, ptr %161, align 4 - %171 = lshr i64 %170, %163 - %172 = trunc i64 %171 to i1 - br i1 %172, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_630_case_0.i.i: ; preds = %cond_exit_630.thread.i.i - %173 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %174 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %173 - %175 = load i64, ptr %174, align 4 - %176 = and i64 %"627_1.sroa.10.0.i.i", 63 - %177 = sub nuw nsw i64 64, %176 - %178 = lshr i64 -1, %177 - %179 = icmp eq i64 %176, 0 - %180 = select i1 %179, i64 0, i64 %178 - %181 = or i64 %175, %180 - store i64 %181, ptr %174, align 4 - %last_valid.i.i.i798 = add i64 %"627_1.sroa.10.0.i.i", 9 - %182 = lshr i64 %last_valid.i.i.i798, 6 - %183 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %last_valid.i.i.i798, 63 - %186 = shl nsw i64 -2, %185 - %187 = icmp eq i64 %185, 63 - %188 = select i1 %187, i64 0, i64 %186 - %189 = or i64 %184, %188 - store i64 %189, ptr %183, align 4 - %reass.sub.i.i.i799 = sub nsw i64 %182, %173 - %.not.i.i.i800 = icmp eq i64 %reass.sub.i.i.i799, -1 - br i1 %.not.i.i.i800, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -190: ; preds = %mask_block_ok.i.i.i801 - %191 = add nuw i64 %.02.i.i.i802, 1 - %exitcond.not.i.i.i805 = icmp eq i64 %.02.i.i.i802, %reass.sub.i.i.i799 - br i1 %exitcond.not.i.i.i805, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -mask_block_ok.i.i.i801: ; preds = %cond_630_case_0.i.i, %190 - %.02.i.i.i802 = phi i64 [ %191, %190 ], [ 0, %cond_630_case_0.i.i ] - %gep.i.i.i803 = getelementptr i64, ptr %174, i64 %.02.i.i.i802 - %192 = load i64, ptr %gep.i.i.i803, align 4 - %193 = icmp eq i64 %192, -1 - br i1 %193, label %190, label %mask_block_err.i.i.i804 - -mask_block_err.i.i.i804: ; preds = %mask_block_ok.i.i.i801 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_630.thread.i.i, %loop_body.preheader.i.i - %"627_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %194, %cond_exit_630.thread.i.i ] - %194 = add nuw nsw i64 %"627_0.0239.i.i", 1 - %195 = add i64 %"627_0.0239.i.i", %"627_1.sroa.10.0.i.i" - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %202, %198 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %194, 10 - br i1 %exitcond.i.i, label %cond_630_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %206 = xor i64 %170, %166 - store i64 %206, ptr %161, align 4 - store i64 %169, ptr %168, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %169) - tail call void @___dec_future_refcount(i64 %169) - %207 = load i64, ptr %156, align 4 - %208 = lshr i64 %207, %"354_0.sroa.15.0168.i" - %209 = trunc i64 %208 to i1 - br i1 %209, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %210 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %158, 1 - %211 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %212 = xor i64 %207, %211 - store i64 %212, ptr %156, align 4 - %213 = getelementptr inbounds nuw i1, ptr %155, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %213, align 1 - %214 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %158, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %190, %cond_630_case_0.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %215 = load i64, ptr %156, align 4 - %216 = and i64 %215, 1023 - store i64 %216, ptr %156, align 4 - %217 = icmp eq i64 %216, 0 - br i1 %217, label %__barray_check_none_borrowed.exit814, label %mask_block_err.i812 - -__barray_check_none_borrowed.exit814: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %218 = tail call ptr @heap_alloc(i64 10) - %219 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %219, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %218, ptr noundef nonnull align 1 dereferenceable(10) %155, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %218) - %220 = load i64, ptr %156, align 4 - %221 = and i64 %220, 1023 - store i64 %221, ptr %156, align 4 - %222 = icmp eq i64 %221, 0 - br i1 %222, label %__barray_check_none_borrowed.exit819, label %mask_block_err.i817 - -mask_block_err.i812: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit819: ; preds = %__barray_check_none_borrowed.exit814 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %223 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %223, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %155, ptr %arr_ptr, align 8 - store ptr %223, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i817: ; preds = %__barray_check_none_borrowed.exit814 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366.1, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %166, %cond_exit_366.1 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 62 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %cond_exit_366, %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = or disjoint i64 %"362_2.01892", 1 + %157 = shl nuw nsw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %160 = lshr i64 %"362_2.01892", 6 + %161 = getelementptr inbounds nuw i64, ptr %5, i64 %160 + %162 = load i64, ptr %161, align 4 + %163 = and i64 %156, 63 + %164 = lshr i64 %162, %163 + %165 = trunc i64 %164 to i1 + br i1 %165, label %cond_exit_366.1, label %panic.i1857 + +cond_exit_366.1: ; preds = %cond_exit_366 + %166 = add nuw nsw i64 %"362_2.01892", 2 + %167 = shl nuw i64 1, %163 + %168 = xor i64 %162, %167 + store i64 %168, ptr %161, align 4 + %169 = getelementptr inbounds nuw i64, ptr %4, i64 %156 + store i64 %156, ptr %169, align 4 + %exitcond1897.1 = icmp eq i64 %166, 100 + br i1 %exitcond1897.1, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366.1 + %170 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %171 = load i64, ptr %170, align 4 + %172 = and i64 %171, 68719476735 + store i64 %172, ptr %170, align 4 + %173 = load i64, ptr %5, align 4 + %174 = icmp eq i64 %173, 0 + %175 = icmp eq i64 %172, 0 + %or.cond = select i1 %174, i1 %175, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %176 = call ptr @heap_alloc(i64 800) + %177 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %177, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %176, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %176) + %178 = load i64, ptr %170, align 4 + %179 = and i64 %178, 68719476735 + store i64 %179, ptr %170, align 4 + %180 = load i64, ptr %5, align 4 + %181 = icmp eq i64 %180, 0 + %182 = icmp eq i64 %179, 0 + %or.cond1902 = select i1 %181, i1 %182, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %183 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %183, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %183, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -698,26 +604,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-unknown-linux-gnu.ll index 1838f39f..a17b454d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-unknown-linux-gnu.ll @@ -3,691 +3,597 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_helios_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__barray_check_bounds.exit.2 - -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not857 = icmp eq i64 %10, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__barray_check_bounds.exit.3 - -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not858 = icmp eq i64 %14, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__barray_check_bounds.exit.4 - -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not859 = icmp eq i64 %18, 0 - br i1 %.not859, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__barray_check_bounds.exit.5 - -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not860 = icmp eq i64 %22, 0 - br i1 %.not860, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__barray_check_bounds.exit.6 - -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not861 = icmp eq i64 %26, 0 - br i1 %.not861, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not862 = icmp eq i64 %30, 0 - br i1 %.not862, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__barray_check_bounds.exit.8 - -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not863 = icmp eq i64 %34, 0 - br i1 %.not863, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not864 = icmp eq i64 %38, 0 - br i1 %.not864, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0843" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0843", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0843" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0843" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0843" - %48 = load i64, ptr %47, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0843" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond850.not = icmp eq i64 %41, 10 - br i1 %exitcond850.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit819 - %"84_0.sroa.0.0845" = phi i64 [ 0, %__barray_check_none_borrowed.exit819 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0845", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0845", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %108, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0845" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0845" - %60 = xor i64 %55, %59 - store i64 %60, ptr %108, align 4 - %61 = getelementptr inbounds nuw double, ptr %107, i64 %"84_0.sroa.0.0845" - store double %58, ptr %61, align 8 - %exitcond851.not = icmp eq i64 %53, 10 - br i1 %exitcond851.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %108, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %108, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %107, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %108, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %108, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %107, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131.1, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0847" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %87, %cond_exit_131.1 ] - %71 = lshr i64 %"126_0.sroa.0.0847", 6 - %72 = getelementptr inbounds nuw i64, ptr %106, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0847", 62 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %cond_exit_131, %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = or disjoint i64 %"126_0.sroa.0.0847", 1 - %78 = shl nuw nsw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %105, i64 %"126_0.sroa.0.0847" - store i64 %"126_0.sroa.0.0847", ptr %80, align 4 - %81 = lshr i64 %"126_0.sroa.0.0847", 6 - %82 = getelementptr inbounds nuw i64, ptr %106, i64 %81 - %83 = load i64, ptr %82, align 4 - %84 = and i64 %77, 63 - %85 = lshr i64 %83, %84 - %86 = trunc i64 %85 to i1 - br i1 %86, label %cond_exit_131.1, label %panic.i780 - -cond_exit_131.1: ; preds = %cond_exit_131 - %87 = add nuw nsw i64 %"126_0.sroa.0.0847", 2 - %88 = shl nuw i64 1, %84 - %89 = xor i64 %83, %88 - store i64 %89, ptr %82, align 4 - %90 = getelementptr inbounds nuw i64, ptr %105, i64 %77 - store i64 %77, ptr %90, align 4 - %exitcond852.not.1 = icmp eq i64 %87, 100 - br i1 %exitcond852.not.1, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131.1 - %91 = getelementptr inbounds nuw i8, ptr %106, i64 8 - %92 = load i64, ptr %91, align 4 - %93 = and i64 %92, 68719476735 - store i64 %93, ptr %91, align 4 - %94 = load i64, ptr %106, align 4 - %95 = icmp eq i64 %94, 0 - %96 = icmp eq i64 %93, 0 - %or.cond = select i1 %95, i1 %96, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %97 = call ptr @heap_alloc(i64 800) - %98 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %98, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %97, ptr noundef nonnull align 1 dereferenceable(800) %105, i64 800, i1 false) - call void @heap_free(ptr nonnull %97) - %99 = load i64, ptr %91, align 4 - %100 = and i64 %99, 68719476735 - store i64 %100, ptr %91, align 4 - %101 = load i64, ptr %106, align 4 - %102 = icmp eq i64 %101, 0 - %103 = icmp eq i64 %100, 0 - %or.cond854 = select i1 %102, i1 %103, i1 false - br i1 %or.cond854, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %104 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %104, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %105, ptr %arr_ptr299, align 8 - store ptr %104, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %105 = tail call ptr @heap_alloc(i64 800) - %106 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %106, i8 -1, i64 16, i1 false) - %107 = tail call ptr @heap_alloc(i64 80) - %108 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %108, align 1 - %109 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %110 = tail call ptr @heap_alloc(i64 80) - %111 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %111, align 1 - br label %__barray_check_bounds.exit.i.i - -112: ; preds = %loop_body.i - %113 = lshr i64 %.fca.2.extract.i.i, 6 - %114 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %113 - %115 = load i64, ptr %114, align 4 - %116 = and i64 %.fca.2.extract.i.i, 63 - %117 = sub nuw nsw i64 64, %116 - %118 = lshr i64 -1, %117 - %119 = icmp eq i64 %116, 0 - %120 = select i1 %119, i64 0, i64 %118 - %121 = or i64 %115, %120 - store i64 %121, ptr %114, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %122 = lshr i64 %last_valid.i.i.i, 6 - %123 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %122 - %124 = load i64, ptr %123, align 4 - %125 = and i64 %last_valid.i.i.i, 63 - %126 = shl nsw i64 -2, %125 - %127 = icmp eq i64 %125, 63 - %128 = select i1 %127, i64 0, i64 %126 - %129 = or i64 %124, %128 - store i64 %129, ptr %123, align 4 - %reass.sub.i.i.i = sub nsw i64 %122, %113 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -130: ; preds = %mask_block_ok.i.i.i - %131 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %112, %130 - %.02.i.i.i = phi i64 [ %131, %130 ], [ 0, %112 ] - %gep.i.i.i = getelementptr i64, ptr %114, i64 %.02.i.i.i - %132 = load i64, ptr %gep.i.i.i, align 4 - %133 = icmp eq i64 %132, -1 - br i1 %133, label %130, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %134, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %109, %cond_exit_161 ], [ %149, %loop_body.i ] - %134 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %135 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %136 = lshr i64 %135, 6 - %137 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %136 - %138 = load i64, ptr %137, align 4 - %139 = and i64 %135, 63 - %140 = lshr i64 %138, %139 - %141 = trunc i64 %140 to i1 - br i1 %141, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %142 = shl nuw i64 1, %139 - %143 = xor i64 %142, %138 - store i64 %143, ptr %137, align 4 - %144 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %135 - %145 = load i64, ptr %144, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %145) - tail call void @___qfree(i64 %145) - %146 = load i64, ptr %111, align 4 - %147 = lshr i64 %146, %"313_0.sroa.15.0178.i" - %148 = trunc i64 %147 to i1 - br i1 %148, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %149 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %134, 1 - %150 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %151 = xor i64 %146, %150 - store i64 %151, ptr %111, align 4 - %152 = getelementptr inbounds nuw i64, ptr %110, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %152, align 4 - %153 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %exitcond.not.i792 = icmp eq i64 %134, 10 - br i1 %exitcond.not.i792, label %112, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %130, %112 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %110, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %111, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %154 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %155 = tail call ptr @heap_alloc(i64 10) - %156 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %156, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %157 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %214, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %158, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %154, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %210, %loop_body.i796 ] - %158 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %157, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %157, 1 - %159 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %panic.i.i.i809, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i809: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %157, 0 - %166 = shl nuw i64 1, %163 - %167 = xor i64 %166, %162 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___inc_future_refcount(i64 %169) - %170 = load i64, ptr %161, align 4 - %171 = lshr i64 %170, %163 - %172 = trunc i64 %171 to i1 - br i1 %172, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_630_case_0.i.i: ; preds = %cond_exit_630.thread.i.i - %173 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %174 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %173 - %175 = load i64, ptr %174, align 4 - %176 = and i64 %"627_1.sroa.10.0.i.i", 63 - %177 = sub nuw nsw i64 64, %176 - %178 = lshr i64 -1, %177 - %179 = icmp eq i64 %176, 0 - %180 = select i1 %179, i64 0, i64 %178 - %181 = or i64 %175, %180 - store i64 %181, ptr %174, align 4 - %last_valid.i.i.i798 = add i64 %"627_1.sroa.10.0.i.i", 9 - %182 = lshr i64 %last_valid.i.i.i798, 6 - %183 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %last_valid.i.i.i798, 63 - %186 = shl nsw i64 -2, %185 - %187 = icmp eq i64 %185, 63 - %188 = select i1 %187, i64 0, i64 %186 - %189 = or i64 %184, %188 - store i64 %189, ptr %183, align 4 - %reass.sub.i.i.i799 = sub nsw i64 %182, %173 - %.not.i.i.i800 = icmp eq i64 %reass.sub.i.i.i799, -1 - br i1 %.not.i.i.i800, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -190: ; preds = %mask_block_ok.i.i.i801 - %191 = add nuw i64 %.02.i.i.i802, 1 - %exitcond.not.i.i.i805 = icmp eq i64 %.02.i.i.i802, %reass.sub.i.i.i799 - br i1 %exitcond.not.i.i.i805, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -mask_block_ok.i.i.i801: ; preds = %cond_630_case_0.i.i, %190 - %.02.i.i.i802 = phi i64 [ %191, %190 ], [ 0, %cond_630_case_0.i.i ] - %gep.i.i.i803 = getelementptr i64, ptr %174, i64 %.02.i.i.i802 - %192 = load i64, ptr %gep.i.i.i803, align 4 - %193 = icmp eq i64 %192, -1 - br i1 %193, label %190, label %mask_block_err.i.i.i804 - -mask_block_err.i.i.i804: ; preds = %mask_block_ok.i.i.i801 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_630.thread.i.i, %loop_body.preheader.i.i - %"627_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %194, %cond_exit_630.thread.i.i ] - %194 = add nuw nsw i64 %"627_0.0239.i.i", 1 - %195 = add i64 %"627_0.0239.i.i", %"627_1.sroa.10.0.i.i" - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %202, %198 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %194, 10 - br i1 %exitcond.i.i, label %cond_630_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %206 = xor i64 %170, %166 - store i64 %206, ptr %161, align 4 - store i64 %169, ptr %168, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %169) - tail call void @___dec_future_refcount(i64 %169) - %207 = load i64, ptr %156, align 4 - %208 = lshr i64 %207, %"354_0.sroa.15.0168.i" - %209 = trunc i64 %208 to i1 - br i1 %209, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %210 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %158, 1 - %211 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %212 = xor i64 %207, %211 - store i64 %212, ptr %156, align 4 - %213 = getelementptr inbounds nuw i1, ptr %155, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %213, align 1 - %214 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %158, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %190, %cond_630_case_0.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %215 = load i64, ptr %156, align 4 - %216 = and i64 %215, 1023 - store i64 %216, ptr %156, align 4 - %217 = icmp eq i64 %216, 0 - br i1 %217, label %__barray_check_none_borrowed.exit814, label %mask_block_err.i812 - -__barray_check_none_borrowed.exit814: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %218 = tail call ptr @heap_alloc(i64 10) - %219 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %219, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %218, ptr noundef nonnull align 1 dereferenceable(10) %155, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %218) - %220 = load i64, ptr %156, align 4 - %221 = and i64 %220, 1023 - store i64 %221, ptr %156, align 4 - %222 = icmp eq i64 %221, 0 - br i1 %222, label %__barray_check_none_borrowed.exit819, label %mask_block_err.i817 - -mask_block_err.i812: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit819: ; preds = %__barray_check_none_borrowed.exit814 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %223 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %223, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %155, ptr %arr_ptr, align 8 - store ptr %223, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i817: ; preds = %__barray_check_none_borrowed.exit814 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366.1, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %166, %cond_exit_366.1 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 62 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %cond_exit_366, %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = or disjoint i64 %"362_2.01892", 1 + %157 = shl nuw nsw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %160 = lshr i64 %"362_2.01892", 6 + %161 = getelementptr inbounds nuw i64, ptr %5, i64 %160 + %162 = load i64, ptr %161, align 4 + %163 = and i64 %156, 63 + %164 = lshr i64 %162, %163 + %165 = trunc i64 %164 to i1 + br i1 %165, label %cond_exit_366.1, label %panic.i1857 + +cond_exit_366.1: ; preds = %cond_exit_366 + %166 = add nuw nsw i64 %"362_2.01892", 2 + %167 = shl nuw i64 1, %163 + %168 = xor i64 %162, %167 + store i64 %168, ptr %161, align 4 + %169 = getelementptr inbounds nuw i64, ptr %4, i64 %156 + store i64 %156, ptr %169, align 4 + %exitcond1897.1 = icmp eq i64 %166, 100 + br i1 %exitcond1897.1, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366.1 + %170 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %171 = load i64, ptr %170, align 4 + %172 = and i64 %171, 68719476735 + store i64 %172, ptr %170, align 4 + %173 = load i64, ptr %5, align 4 + %174 = icmp eq i64 %173, 0 + %175 = icmp eq i64 %172, 0 + %or.cond = select i1 %174, i1 %175, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %176 = call ptr @heap_alloc(i64 800) + %177 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %177, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %176, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %176) + %178 = load i64, ptr %170, align 4 + %179 = and i64 %178, 68719476735 + store i64 %179, ptr %170, align 4 + %180 = load i64, ptr %5, align 4 + %181 = icmp eq i64 %180, 0 + %182 = icmp eq i64 %179, 0 + %or.cond1902 = select i1 %181, i1 %182, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %183 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %183, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %183, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -698,26 +604,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-windows-gnu.ll index 2fc887c0..87efbb58 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-helios-x86_64-windows-gnu.ll @@ -3,691 +3,597 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_helios_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__barray_check_bounds.exit.2 - -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not857 = icmp eq i64 %10, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__barray_check_bounds.exit.3 - -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not858 = icmp eq i64 %14, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__barray_check_bounds.exit.4 - -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not859 = icmp eq i64 %18, 0 - br i1 %.not859, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__barray_check_bounds.exit.5 - -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not860 = icmp eq i64 %22, 0 - br i1 %.not860, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__barray_check_bounds.exit.6 - -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not861 = icmp eq i64 %26, 0 - br i1 %.not861, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not862 = icmp eq i64 %30, 0 - br i1 %.not862, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__barray_check_bounds.exit.8 - -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not863 = icmp eq i64 %34, 0 - br i1 %.not863, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not864 = icmp eq i64 %38, 0 - br i1 %.not864, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0843" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0843", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0843" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0843" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0843" - %48 = load i64, ptr %47, align 4 - tail call void @___rxy(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0843" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond850.not = icmp eq i64 %41, 10 - br i1 %exitcond850.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit819 - %"84_0.sroa.0.0845" = phi i64 [ 0, %__barray_check_none_borrowed.exit819 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0845", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0845", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %108, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0845" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0845" - %60 = xor i64 %55, %59 - store i64 %60, ptr %108, align 4 - %61 = getelementptr inbounds nuw double, ptr %107, i64 %"84_0.sroa.0.0845" - store double %58, ptr %61, align 8 - %exitcond851.not = icmp eq i64 %53, 10 - br i1 %exitcond851.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %108, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %108, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %107, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %108, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %108, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %107, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131.1, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0847" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %87, %cond_exit_131.1 ] - %71 = lshr i64 %"126_0.sroa.0.0847", 6 - %72 = getelementptr inbounds nuw i64, ptr %106, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0847", 62 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %cond_exit_131, %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = or disjoint i64 %"126_0.sroa.0.0847", 1 - %78 = shl nuw nsw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %105, i64 %"126_0.sroa.0.0847" - store i64 %"126_0.sroa.0.0847", ptr %80, align 4 - %81 = lshr i64 %"126_0.sroa.0.0847", 6 - %82 = getelementptr inbounds nuw i64, ptr %106, i64 %81 - %83 = load i64, ptr %82, align 4 - %84 = and i64 %77, 63 - %85 = lshr i64 %83, %84 - %86 = trunc i64 %85 to i1 - br i1 %86, label %cond_exit_131.1, label %panic.i780 - -cond_exit_131.1: ; preds = %cond_exit_131 - %87 = add nuw nsw i64 %"126_0.sroa.0.0847", 2 - %88 = shl nuw i64 1, %84 - %89 = xor i64 %83, %88 - store i64 %89, ptr %82, align 4 - %90 = getelementptr inbounds nuw i64, ptr %105, i64 %77 - store i64 %77, ptr %90, align 4 - %exitcond852.not.1 = icmp eq i64 %87, 100 - br i1 %exitcond852.not.1, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131.1 - %91 = getelementptr inbounds nuw i8, ptr %106, i64 8 - %92 = load i64, ptr %91, align 4 - %93 = and i64 %92, 68719476735 - store i64 %93, ptr %91, align 4 - %94 = load i64, ptr %106, align 4 - %95 = icmp eq i64 %94, 0 - %96 = icmp eq i64 %93, 0 - %or.cond = select i1 %95, i1 %96, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %97 = call ptr @heap_alloc(i64 800) - %98 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %98, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %97, ptr noundef nonnull align 1 dereferenceable(800) %105, i64 800, i1 false) - call void @heap_free(ptr nonnull %97) - %99 = load i64, ptr %91, align 4 - %100 = and i64 %99, 68719476735 - store i64 %100, ptr %91, align 4 - %101 = load i64, ptr %106, align 4 - %102 = icmp eq i64 %101, 0 - %103 = icmp eq i64 %100, 0 - %or.cond854 = select i1 %102, i1 %103, i1 false - br i1 %or.cond854, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %104 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %104, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %105, ptr %arr_ptr299, align 8 - store ptr %104, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %105 = tail call ptr @heap_alloc(i64 800) - %106 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %106, i8 -1, i64 16, i1 false) - %107 = tail call ptr @heap_alloc(i64 80) - %108 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %108, align 1 - %109 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %110 = tail call ptr @heap_alloc(i64 80) - %111 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %111, align 1 - br label %__barray_check_bounds.exit.i.i - -112: ; preds = %loop_body.i - %113 = lshr i64 %.fca.2.extract.i.i, 6 - %114 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %113 - %115 = load i64, ptr %114, align 4 - %116 = and i64 %.fca.2.extract.i.i, 63 - %117 = sub nuw nsw i64 64, %116 - %118 = lshr i64 -1, %117 - %119 = icmp eq i64 %116, 0 - %120 = select i1 %119, i64 0, i64 %118 - %121 = or i64 %115, %120 - store i64 %121, ptr %114, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %122 = lshr i64 %last_valid.i.i.i, 6 - %123 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %122 - %124 = load i64, ptr %123, align 4 - %125 = and i64 %last_valid.i.i.i, 63 - %126 = shl nsw i64 -2, %125 - %127 = icmp eq i64 %125, 63 - %128 = select i1 %127, i64 0, i64 %126 - %129 = or i64 %124, %128 - store i64 %129, ptr %123, align 4 - %reass.sub.i.i.i = sub nsw i64 %122, %113 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -130: ; preds = %mask_block_ok.i.i.i - %131 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %112, %130 - %.02.i.i.i = phi i64 [ %131, %130 ], [ 0, %112 ] - %gep.i.i.i = getelementptr i64, ptr %114, i64 %.02.i.i.i - %132 = load i64, ptr %gep.i.i.i, align 4 - %133 = icmp eq i64 %132, -1 - br i1 %133, label %130, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %134, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %109, %cond_exit_161 ], [ %149, %loop_body.i ] - %134 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %135 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %136 = lshr i64 %135, 6 - %137 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %136 - %138 = load i64, ptr %137, align 4 - %139 = and i64 %135, 63 - %140 = lshr i64 %138, %139 - %141 = trunc i64 %140 to i1 - br i1 %141, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %142 = shl nuw i64 1, %139 - %143 = xor i64 %142, %138 - store i64 %143, ptr %137, align 4 - %144 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %135 - %145 = load i64, ptr %144, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %145) - tail call void @___qfree(i64 %145) - %146 = load i64, ptr %111, align 4 - %147 = lshr i64 %146, %"313_0.sroa.15.0178.i" - %148 = trunc i64 %147 to i1 - br i1 %148, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %149 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %134, 1 - %150 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %151 = xor i64 %146, %150 - store i64 %151, ptr %111, align 4 - %152 = getelementptr inbounds nuw i64, ptr %110, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %152, align 4 - %153 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %exitcond.not.i792 = icmp eq i64 %134, 10 - br i1 %exitcond.not.i792, label %112, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %130, %112 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %110, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %111, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %154 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %155 = tail call ptr @heap_alloc(i64 10) - %156 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %156, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %157 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %214, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %158, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %154, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %210, %loop_body.i796 ] - %158 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %157, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %157, 1 - %159 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %panic.i.i.i809, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i809: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %157, 0 - %166 = shl nuw i64 1, %163 - %167 = xor i64 %166, %162 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___inc_future_refcount(i64 %169) - %170 = load i64, ptr %161, align 4 - %171 = lshr i64 %170, %163 - %172 = trunc i64 %171 to i1 - br i1 %172, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_630_case_0.i.i: ; preds = %cond_exit_630.thread.i.i - %173 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %174 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %173 - %175 = load i64, ptr %174, align 4 - %176 = and i64 %"627_1.sroa.10.0.i.i", 63 - %177 = sub nuw nsw i64 64, %176 - %178 = lshr i64 -1, %177 - %179 = icmp eq i64 %176, 0 - %180 = select i1 %179, i64 0, i64 %178 - %181 = or i64 %175, %180 - store i64 %181, ptr %174, align 4 - %last_valid.i.i.i798 = add i64 %"627_1.sroa.10.0.i.i", 9 - %182 = lshr i64 %last_valid.i.i.i798, 6 - %183 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %last_valid.i.i.i798, 63 - %186 = shl nsw i64 -2, %185 - %187 = icmp eq i64 %185, 63 - %188 = select i1 %187, i64 0, i64 %186 - %189 = or i64 %184, %188 - store i64 %189, ptr %183, align 4 - %reass.sub.i.i.i799 = sub nsw i64 %182, %173 - %.not.i.i.i800 = icmp eq i64 %reass.sub.i.i.i799, -1 - br i1 %.not.i.i.i800, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -190: ; preds = %mask_block_ok.i.i.i801 - %191 = add nuw i64 %.02.i.i.i802, 1 - %exitcond.not.i.i.i805 = icmp eq i64 %.02.i.i.i802, %reass.sub.i.i.i799 - br i1 %exitcond.not.i.i.i805, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -mask_block_ok.i.i.i801: ; preds = %cond_630_case_0.i.i, %190 - %.02.i.i.i802 = phi i64 [ %191, %190 ], [ 0, %cond_630_case_0.i.i ] - %gep.i.i.i803 = getelementptr i64, ptr %174, i64 %.02.i.i.i802 - %192 = load i64, ptr %gep.i.i.i803, align 4 - %193 = icmp eq i64 %192, -1 - br i1 %193, label %190, label %mask_block_err.i.i.i804 - -mask_block_err.i.i.i804: ; preds = %mask_block_ok.i.i.i801 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_630.thread.i.i, %loop_body.preheader.i.i - %"627_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %194, %cond_exit_630.thread.i.i ] - %194 = add nuw nsw i64 %"627_0.0239.i.i", 1 - %195 = add i64 %"627_0.0239.i.i", %"627_1.sroa.10.0.i.i" - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %202, %198 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %194, 10 - br i1 %exitcond.i.i, label %cond_630_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %206 = xor i64 %170, %166 - store i64 %206, ptr %161, align 4 - store i64 %169, ptr %168, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %169) - tail call void @___dec_future_refcount(i64 %169) - %207 = load i64, ptr %156, align 4 - %208 = lshr i64 %207, %"354_0.sroa.15.0168.i" - %209 = trunc i64 %208 to i1 - br i1 %209, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %210 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %158, 1 - %211 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %212 = xor i64 %207, %211 - store i64 %212, ptr %156, align 4 - %213 = getelementptr inbounds nuw i1, ptr %155, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %213, align 1 - %214 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %158, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %190, %cond_630_case_0.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %215 = load i64, ptr %156, align 4 - %216 = and i64 %215, 1023 - store i64 %216, ptr %156, align 4 - %217 = icmp eq i64 %216, 0 - br i1 %217, label %__barray_check_none_borrowed.exit814, label %mask_block_err.i812 - -__barray_check_none_borrowed.exit814: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %218 = tail call ptr @heap_alloc(i64 10) - %219 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %219, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %218, ptr noundef nonnull align 1 dereferenceable(10) %155, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %218) - %220 = load i64, ptr %156, align 4 - %221 = and i64 %220, 1023 - store i64 %221, ptr %156, align 4 - %222 = icmp eq i64 %221, 0 - br i1 %222, label %__barray_check_none_borrowed.exit819, label %mask_block_err.i817 - -mask_block_err.i812: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit819: ; preds = %__barray_check_none_borrowed.exit814 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %223 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %223, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %155, ptr %arr_ptr, align 8 - store ptr %223, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i817: ; preds = %__barray_check_none_borrowed.exit814 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366.1, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %166, %cond_exit_366.1 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 62 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %cond_exit_366, %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = or disjoint i64 %"362_2.01892", 1 + %157 = shl nuw nsw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %160 = lshr i64 %"362_2.01892", 6 + %161 = getelementptr inbounds nuw i64, ptr %5, i64 %160 + %162 = load i64, ptr %161, align 4 + %163 = and i64 %156, 63 + %164 = lshr i64 %162, %163 + %165 = trunc i64 %164 to i1 + br i1 %165, label %cond_exit_366.1, label %panic.i1857 + +cond_exit_366.1: ; preds = %cond_exit_366 + %166 = add nuw nsw i64 %"362_2.01892", 2 + %167 = shl nuw i64 1, %163 + %168 = xor i64 %162, %167 + store i64 %168, ptr %161, align 4 + %169 = getelementptr inbounds nuw i64, ptr %4, i64 %156 + store i64 %156, ptr %169, align 4 + %exitcond1897.1 = icmp eq i64 %166, 100 + br i1 %exitcond1897.1, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366.1 + %170 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %171 = load i64, ptr %170, align 4 + %172 = and i64 %171, 68719476735 + store i64 %172, ptr %170, align 4 + %173 = load i64, ptr %5, align 4 + %174 = icmp eq i64 %173, 0 + %175 = icmp eq i64 %172, 0 + %or.cond = select i1 %174, i1 %175, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %176 = call ptr @heap_alloc(i64 800) + %177 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %177, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %176, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %176) + %178 = load i64, ptr %170, align 4 + %179 = and i64 %178, 68719476735 + store i64 %179, ptr %170, align 4 + %180 = load i64, ptr %5, align 4 + %181 = icmp eq i64 %180, 0 + %182 = icmp eq i64 %179, 0 + %or.cond1902 = select i1 %181, i1 %182, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %183 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %183, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %183, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -698,26 +604,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-apple-darwin.ll index fcae28e4..2c28463d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-apple-darwin.ll @@ -3,830 +3,582 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_sol_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.580.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.580.exit.8, %__hugr__.__tk2_sol_qalloc.580.exit.7, %__hugr__.__tk2_sol_qalloc.580.exit.6, %__hugr__.__tk2_sol_qalloc.580.exit.5, %__hugr__.__tk2_sol_qalloc.580.exit.4, %__hugr__.__tk2_sol_qalloc.580.exit.3, %__hugr__.__tk2_sol_qalloc.580.exit.2, %__hugr__.__tk2_sol_qalloc.580.exit.1, %__hugr__.__tk2_sol_qalloc.580.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.1 - -__hugr__.__tk2_sol_qalloc.580.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.2 - -__hugr__.__tk2_sol_qalloc.580.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not851 = icmp eq i64 %10, 0 - br i1 %.not851, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.3 - -__hugr__.__tk2_sol_qalloc.580.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not852 = icmp eq i64 %14, 0 - br i1 %.not852, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.4 - -__hugr__.__tk2_sol_qalloc.580.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not853 = icmp eq i64 %18, 0 - br i1 %.not853, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.5 - -__hugr__.__tk2_sol_qalloc.580.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not854 = icmp eq i64 %22, 0 - br i1 %.not854, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.6 - -__hugr__.__tk2_sol_qalloc.580.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not855 = icmp eq i64 %26, 0 - br i1 %.not855, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.7 - -__hugr__.__tk2_sol_qalloc.580.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not856 = icmp eq i64 %30, 0 - br i1 %.not856, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.8 - -__hugr__.__tk2_sol_qalloc.580.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not857 = icmp eq i64 %34, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not858 = icmp eq i64 %38, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0842" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0842", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0842" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0842" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0842" - %48 = load i64, ptr %47, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0842" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond.not = icmp eq i64 %41, 10 - br i1 %exitcond.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit818 - %"84_0.sroa.0.0844" = phi i64 [ 0, %__barray_check_none_borrowed.exit818 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0844", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0844", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %98, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0844" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0844" - %60 = xor i64 %55, %59 - store i64 %60, ptr %98, align 4 - %61 = getelementptr inbounds nuw double, ptr %97, i64 %"84_0.sroa.0.0844" - store double %58, ptr %61, align 8 - %exitcond849.not = icmp eq i64 %53, 10 - br i1 %exitcond849.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %98, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %98, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %97, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %98, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %98, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %97, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0846" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %77, %cond_exit_131 ] - %71 = lshr i64 %"126_0.sroa.0.0846", 6 - %72 = getelementptr inbounds nuw i64, ptr %96, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0846", 63 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = add nuw nsw i64 %"126_0.sroa.0.0846", 1 - %78 = shl nuw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %95, i64 %"126_0.sroa.0.0846" - store i64 %"126_0.sroa.0.0846", ptr %80, align 4 - %exitcond850.not = icmp eq i64 %77, 100 - br i1 %exitcond850.not, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131 - %81 = getelementptr inbounds nuw i8, ptr %96, i64 8 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %82, 68719476735 - store i64 %83, ptr %81, align 4 - %84 = load i64, ptr %96, align 4 - %85 = icmp eq i64 %84, 0 - %86 = icmp eq i64 %83, 0 - %or.cond = select i1 %85, i1 %86, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %87 = call ptr @heap_alloc(i64 800) - %88 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %88, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %87, ptr noundef nonnull align 1 dereferenceable(800) %95, i64 800, i1 false) - call void @heap_free(ptr nonnull %87) - %89 = load i64, ptr %81, align 4 - %90 = and i64 %89, 68719476735 - store i64 %90, ptr %81, align 4 - %91 = load i64, ptr %96, align 4 - %92 = icmp eq i64 %91, 0 - %93 = icmp eq i64 %90, 0 - %or.cond860 = select i1 %92, i1 %93, i1 false - br i1 %or.cond860, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %94 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %94, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %95, ptr %arr_ptr299, align 8 - store ptr %94, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void - -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %95 = tail call ptr @heap_alloc(i64 800) - %96 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %96, i8 -1, i64 16, i1 false) - %97 = tail call ptr @heap_alloc(i64 80) - %98 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %98, align 1 - %99 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %100 = tail call ptr @heap_alloc(i64 80) - %101 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %101, align 1 - br label %__barray_check_bounds.exit.i.i - -102: ; preds = %loop_body.i - %103 = lshr i64 %.fca.2.extract.i.i, 6 - %104 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %.fca.2.extract.i.i, 63 - %107 = sub nuw nsw i64 64, %106 - %108 = lshr i64 -1, %107 - %109 = icmp eq i64 %106, 0 - %110 = select i1 %109, i64 0, i64 %108 - %111 = or i64 %105, %110 - store i64 %111, ptr %104, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %112 = lshr i64 %last_valid.i.i.i, 6 - %113 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %112 - %114 = load i64, ptr %113, align 4 - %115 = and i64 %last_valid.i.i.i, 63 - %116 = shl nsw i64 -2, %115 - %117 = icmp eq i64 %115, 63 - %118 = select i1 %117, i64 0, i64 %116 - %119 = or i64 %114, %118 - store i64 %119, ptr %113, align 4 - %reass.sub.i.i.i = sub nsw i64 %112, %103 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -120: ; preds = %mask_block_ok.i.i.i - %121 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %102, %120 - %.02.i.i.i = phi i64 [ %121, %120 ], [ 0, %102 ] - %gep.i.i.i = getelementptr i64, ptr %104, i64 %.02.i.i.i - %122 = load i64, ptr %gep.i.i.i, align 4 - %123 = icmp eq i64 %122, -1 - br i1 %123, label %120, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %124, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %99, %cond_exit_161 ], [ %139, %loop_body.i ] - %124 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %125 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %126 = lshr i64 %125, 6 - %127 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %126 - %128 = load i64, ptr %127, align 4 - %129 = and i64 %125, 63 - %130 = lshr i64 %128, %129 - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %132 = shl nuw i64 1, %129 - %133 = xor i64 %132, %128 - store i64 %133, ptr %127, align 4 - %134 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %125 - %135 = load i64, ptr %134, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %135) - tail call void @___qfree(i64 %135) - %136 = load i64, ptr %101, align 4 - %137 = lshr i64 %136, %"313_0.sroa.15.0178.i" - %138 = trunc i64 %137 to i1 - br i1 %138, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %139 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %124, 1 - %140 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %141 = xor i64 %136, %140 - store i64 %141, ptr %101, align 4 - %142 = getelementptr inbounds nuw i64, ptr %100, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %142, align 4 - %143 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %143, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %143, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %143, 2 - %exitcond.not.i792 = icmp eq i64 %124, 10 - br i1 %exitcond.not.i792, label %102, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %120, %102 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %100, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %101, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %144 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %145 = tail call ptr @heap_alloc(i64 10) - %146 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %146, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 0 - %147 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %148 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %147 - %149 = load i64, ptr %148, align 4 - %150 = and i64 %"627_1.sroa.10.0.i.i", 63 - %151 = lshr i64 %149, %150 - %152 = trunc i64 %151 to i1 - br i1 %152, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %153 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %295, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %154, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %144, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %291, %loop_body.i796 ] - %154 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %155 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %156 = lshr i64 %155, 6 - %157 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %156 - %158 = load i64, ptr %157, align 4 - %159 = and i64 %155, 63 - %160 = lshr i64 %158, %159 - %161 = trunc i64 %160 to i1 - br i1 %161, label %panic.i.i.i808, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i808: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %162 = shl nuw i64 1, %159 - %163 = xor i64 %162, %158 - store i64 %163, ptr %157, align 4 - %164 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %155 - %165 = load i64, ptr %164, align 4 - tail call void @___inc_future_refcount(i64 %165) - %166 = load i64, ptr %157, align 4 - %167 = lshr i64 %166, %159 - %168 = trunc i64 %167 to i1 - br i1 %168, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -169: ; preds = %mask_block_ok.i.i.i800 - %170 = add nuw i64 %.02.i.i.i801, 1 - %exitcond.not.i.i.i804 = icmp eq i64 %.02.i.i.i801, %reass.sub.i.i.i798 - br i1 %exitcond.not.i.i.i804, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -mask_block_ok.i.i.i800: ; preds = %cond_exit_630.thread.9.i.i, %169 - %.02.i.i.i801 = phi i64 [ %170, %169 ], [ 0, %cond_exit_630.thread.9.i.i ] - %gep.i.i.i802 = getelementptr i64, ptr %148, i64 %.02.i.i.i801 - %171 = load i64, ptr %gep.i.i.i802, align 4 - %172 = icmp eq i64 %171, -1 - br i1 %172, label %169, label %mask_block_err.i.i.i803 - -mask_block_err.i.i.i803: ; preds = %mask_block_ok.i.i.i800 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %173 = shl nuw i64 1, %150 - %174 = xor i64 %149, %173 - store i64 %174, ptr %148, align 4 - %175 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %"627_1.sroa.10.0.i.i" - %176 = load i64, ptr %175, align 4 - tail call void @___dec_future_refcount(i64 %176) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %177 = add i64 %"627_1.sroa.10.0.i.i", 1 - %178 = lshr i64 %177, 6 - %179 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %178 - %180 = load i64, ptr %179, align 4 - %181 = and i64 %177, 63 - %182 = lshr i64 %180, %181 - %183 = trunc i64 %182 to i1 - br i1 %183, label %cond_exit_630.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_630.thread.i.i - %184 = shl nuw i64 1, %181 - %185 = xor i64 %180, %184 - store i64 %185, ptr %179, align 4 - %186 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %177 - %187 = load i64, ptr %186, align 4 - tail call void @___dec_future_refcount(i64 %187) - br label %cond_exit_630.thread.1.i.i - -cond_exit_630.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_630.thread.i.i - %188 = add i64 %"627_1.sroa.10.0.i.i", 2 - %189 = lshr i64 %188, 6 - %190 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %189 - %191 = load i64, ptr %190, align 4 - %192 = and i64 %188, 63 - %193 = lshr i64 %191, %192 - %194 = trunc i64 %193 to i1 - br i1 %194, label %cond_exit_630.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_630.thread.1.i.i - %195 = shl nuw i64 1, %192 - %196 = xor i64 %191, %195 - store i64 %196, ptr %190, align 4 - %197 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %188 - %198 = load i64, ptr %197, align 4 - tail call void @___dec_future_refcount(i64 %198) - br label %cond_exit_630.thread.2.i.i - -cond_exit_630.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_630.thread.1.i.i - %199 = add i64 %"627_1.sroa.10.0.i.i", 3 - %200 = lshr i64 %199, 6 - %201 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %200 - %202 = load i64, ptr %201, align 4 - %203 = and i64 %199, 63 - %204 = lshr i64 %202, %203 - %205 = trunc i64 %204 to i1 - br i1 %205, label %cond_exit_630.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_630.thread.2.i.i - %206 = shl nuw i64 1, %203 - %207 = xor i64 %202, %206 - store i64 %207, ptr %201, align 4 - %208 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %199 - %209 = load i64, ptr %208, align 4 - tail call void @___dec_future_refcount(i64 %209) - br label %cond_exit_630.thread.3.i.i - -cond_exit_630.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_630.thread.2.i.i - %210 = add i64 %"627_1.sroa.10.0.i.i", 4 - %211 = lshr i64 %210, 6 - %212 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %211 - %213 = load i64, ptr %212, align 4 - %214 = and i64 %210, 63 - %215 = lshr i64 %213, %214 - %216 = trunc i64 %215 to i1 - br i1 %216, label %cond_exit_630.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_630.thread.3.i.i - %217 = shl nuw i64 1, %214 - %218 = xor i64 %213, %217 - store i64 %218, ptr %212, align 4 - %219 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %210 - %220 = load i64, ptr %219, align 4 - tail call void @___dec_future_refcount(i64 %220) - br label %cond_exit_630.thread.4.i.i - -cond_exit_630.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_630.thread.3.i.i - %221 = add i64 %"627_1.sroa.10.0.i.i", 5 - %222 = lshr i64 %221, 6 - %223 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %222 - %224 = load i64, ptr %223, align 4 - %225 = and i64 %221, 63 - %226 = lshr i64 %224, %225 - %227 = trunc i64 %226 to i1 - br i1 %227, label %cond_exit_630.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_630.thread.4.i.i - %228 = shl nuw i64 1, %225 - %229 = xor i64 %224, %228 - store i64 %229, ptr %223, align 4 - %230 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %221 - %231 = load i64, ptr %230, align 4 - tail call void @___dec_future_refcount(i64 %231) - br label %cond_exit_630.thread.5.i.i - -cond_exit_630.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_630.thread.4.i.i - %232 = add i64 %"627_1.sroa.10.0.i.i", 6 - %233 = lshr i64 %232, 6 - %234 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %233 - %235 = load i64, ptr %234, align 4 - %236 = and i64 %232, 63 - %237 = lshr i64 %235, %236 - %238 = trunc i64 %237 to i1 - br i1 %238, label %cond_exit_630.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_630.thread.5.i.i - %239 = shl nuw i64 1, %236 - %240 = xor i64 %235, %239 - store i64 %240, ptr %234, align 4 - %241 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %232 - %242 = load i64, ptr %241, align 4 - tail call void @___dec_future_refcount(i64 %242) - br label %cond_exit_630.thread.6.i.i - -cond_exit_630.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_630.thread.5.i.i - %243 = add i64 %"627_1.sroa.10.0.i.i", 7 - %244 = lshr i64 %243, 6 - %245 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %244 - %246 = load i64, ptr %245, align 4 - %247 = and i64 %243, 63 - %248 = lshr i64 %246, %247 - %249 = trunc i64 %248 to i1 - br i1 %249, label %cond_exit_630.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_630.thread.6.i.i - %250 = shl nuw i64 1, %247 - %251 = xor i64 %246, %250 - store i64 %251, ptr %245, align 4 - %252 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %243 - %253 = load i64, ptr %252, align 4 - tail call void @___dec_future_refcount(i64 %253) - br label %cond_exit_630.thread.7.i.i - -cond_exit_630.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_630.thread.6.i.i - %254 = add i64 %"627_1.sroa.10.0.i.i", 8 - %255 = lshr i64 %254, 6 - %256 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %255 - %257 = load i64, ptr %256, align 4 - %258 = and i64 %254, 63 - %259 = lshr i64 %257, %258 - %260 = trunc i64 %259 to i1 - br i1 %260, label %cond_exit_630.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_630.thread.7.i.i - %261 = shl nuw i64 1, %258 - %262 = xor i64 %257, %261 - store i64 %262, ptr %256, align 4 - %263 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %254 - %264 = load i64, ptr %263, align 4 - tail call void @___dec_future_refcount(i64 %264) - br label %cond_exit_630.thread.8.i.i - -cond_exit_630.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_630.thread.7.i.i - %265 = add i64 %"627_1.sroa.10.0.i.i", 9 - %266 = lshr i64 %265, 6 - %267 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %266 - %268 = load i64, ptr %267, align 4 - %269 = and i64 %265, 63 - %270 = lshr i64 %268, %269 - %271 = trunc i64 %270 to i1 - br i1 %271, label %cond_exit_630.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_630.thread.8.i.i - %272 = shl nuw i64 1, %269 - %273 = xor i64 %268, %272 - store i64 %273, ptr %267, align 4 - %274 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %265 - %275 = load i64, ptr %274, align 4 - tail call void @___dec_future_refcount(i64 %275) - br label %cond_exit_630.thread.9.i.i - -cond_exit_630.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_630.thread.8.i.i - %276 = load i64, ptr %148, align 4 - %277 = sub nuw nsw i64 64, %150 - %278 = lshr i64 -1, %277 - %279 = icmp eq i64 %150, 0 - %280 = select i1 %279, i64 0, i64 %278 - %281 = or i64 %276, %280 - store i64 %281, ptr %148, align 4 - %282 = load i64, ptr %267, align 4 - %283 = shl nsw i64 -2, %269 - %284 = icmp eq i64 %269, 63 - %285 = select i1 %284, i64 0, i64 %283 - %286 = or i64 %282, %285 - store i64 %286, ptr %267, align 4 - %reass.sub.i.i.i798 = sub nsw i64 %266, %147 - %.not.i.i.i799 = icmp eq i64 %reass.sub.i.i.i798, -1 - br i1 %.not.i.i.i799, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %287 = xor i64 %166, %162 - store i64 %287, ptr %157, align 4 - store i64 %165, ptr %164, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %165) - tail call void @___dec_future_refcount(i64 %165) - %288 = load i64, ptr %146, align 4 - %289 = lshr i64 %288, %"354_0.sroa.15.0168.i" - %290 = trunc i64 %289 to i1 - br i1 %290, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %291 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %154, 1 - %292 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %293 = xor i64 %288, %292 - store i64 %293, ptr %146, align 4 - %294 = getelementptr inbounds nuw i1, ptr %145, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %294, align 1 - %295 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %154, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %169, %cond_exit_630.thread.9.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %296 = load i64, ptr %146, align 4 - %297 = and i64 %296, 1023 - store i64 %297, ptr %146, align 4 - %298 = icmp eq i64 %297, 0 - br i1 %298, label %__barray_check_none_borrowed.exit813, label %mask_block_err.i811 - -__barray_check_none_borrowed.exit813: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %299 = tail call ptr @heap_alloc(i64 10) - %300 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %300, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %299, ptr noundef nonnull align 1 dereferenceable(10) %145, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %299) - %301 = load i64, ptr %146, align 4 - %302 = and i64 %301, 1023 - store i64 %302, ptr %146, align 4 - %303 = icmp eq i64 %302, 0 - br i1 %303, label %__barray_check_none_borrowed.exit818, label %mask_block_err.i816 - -mask_block_err.i811: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit818: ; preds = %__barray_check_none_borrowed.exit813 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %304 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %304, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %145, ptr %arr_ptr, align 8 - store ptr %304, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i816: ; preds = %__barray_check_none_borrowed.exit813 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %156, %cond_exit_366 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 63 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = add nuw nsw i64 %"362_2.01892", 1 + %157 = shl nuw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %exitcond1897 = icmp eq i64 %156, 100 + br i1 %exitcond1897, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366 + %160 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %161 = load i64, ptr %160, align 4 + %162 = and i64 %161, 68719476735 + store i64 %162, ptr %160, align 4 + %163 = load i64, ptr %5, align 4 + %164 = icmp eq i64 %163, 0 + %165 = icmp eq i64 %162, 0 + %or.cond = select i1 %164, i1 %165, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %166 = call ptr @heap_alloc(i64 800) + %167 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %167, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %166, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %166) + %168 = load i64, ptr %160, align 4 + %169 = and i64 %168, 68719476735 + store i64 %169, ptr %160, align 4 + %170 = load i64, ptr %5, align 4 + %171 = icmp eq i64 %170, 0 + %172 = icmp eq i64 %169, 0 + %or.cond1902 = select i1 %171, i1 %172, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %173 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %173, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %173, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -837,26 +589,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-unknown-linux-gnu.ll index daa74637..69ee588b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-aarch64-unknown-linux-gnu.ll @@ -3,830 +3,582 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_sol_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.580.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.580.exit.8, %__hugr__.__tk2_sol_qalloc.580.exit.7, %__hugr__.__tk2_sol_qalloc.580.exit.6, %__hugr__.__tk2_sol_qalloc.580.exit.5, %__hugr__.__tk2_sol_qalloc.580.exit.4, %__hugr__.__tk2_sol_qalloc.580.exit.3, %__hugr__.__tk2_sol_qalloc.580.exit.2, %__hugr__.__tk2_sol_qalloc.580.exit.1, %__hugr__.__tk2_sol_qalloc.580.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.1 - -__hugr__.__tk2_sol_qalloc.580.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.2 - -__hugr__.__tk2_sol_qalloc.580.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not851 = icmp eq i64 %10, 0 - br i1 %.not851, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.3 - -__hugr__.__tk2_sol_qalloc.580.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not852 = icmp eq i64 %14, 0 - br i1 %.not852, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.4 - -__hugr__.__tk2_sol_qalloc.580.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not853 = icmp eq i64 %18, 0 - br i1 %.not853, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.5 - -__hugr__.__tk2_sol_qalloc.580.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not854 = icmp eq i64 %22, 0 - br i1 %.not854, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.6 - -__hugr__.__tk2_sol_qalloc.580.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not855 = icmp eq i64 %26, 0 - br i1 %.not855, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.7 - -__hugr__.__tk2_sol_qalloc.580.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not856 = icmp eq i64 %30, 0 - br i1 %.not856, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__hugr__.__tk2_sol_qalloc.580.exit.8 - -__hugr__.__tk2_sol_qalloc.580.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not857 = icmp eq i64 %34, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.580.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not858 = icmp eq i64 %38, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0842" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0842", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0842" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0842" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0842" - %48 = load i64, ptr %47, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0842" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond.not = icmp eq i64 %41, 10 - br i1 %exitcond.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit818 - %"84_0.sroa.0.0844" = phi i64 [ 0, %__barray_check_none_borrowed.exit818 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0844", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0844", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %98, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0844" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0844" - %60 = xor i64 %55, %59 - store i64 %60, ptr %98, align 4 - %61 = getelementptr inbounds nuw double, ptr %97, i64 %"84_0.sroa.0.0844" - store double %58, ptr %61, align 8 - %exitcond849.not = icmp eq i64 %53, 10 - br i1 %exitcond849.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %98, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %98, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %97, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %98, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %98, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %97, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0846" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %77, %cond_exit_131 ] - %71 = lshr i64 %"126_0.sroa.0.0846", 6 - %72 = getelementptr inbounds nuw i64, ptr %96, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0846", 63 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = add nuw nsw i64 %"126_0.sroa.0.0846", 1 - %78 = shl nuw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %95, i64 %"126_0.sroa.0.0846" - store i64 %"126_0.sroa.0.0846", ptr %80, align 4 - %exitcond850.not = icmp eq i64 %77, 100 - br i1 %exitcond850.not, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131 - %81 = getelementptr inbounds nuw i8, ptr %96, i64 8 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %82, 68719476735 - store i64 %83, ptr %81, align 4 - %84 = load i64, ptr %96, align 4 - %85 = icmp eq i64 %84, 0 - %86 = icmp eq i64 %83, 0 - %or.cond = select i1 %85, i1 %86, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %87 = call ptr @heap_alloc(i64 800) - %88 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %88, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %87, ptr noundef nonnull align 1 dereferenceable(800) %95, i64 800, i1 false) - call void @heap_free(ptr nonnull %87) - %89 = load i64, ptr %81, align 4 - %90 = and i64 %89, 68719476735 - store i64 %90, ptr %81, align 4 - %91 = load i64, ptr %96, align 4 - %92 = icmp eq i64 %91, 0 - %93 = icmp eq i64 %90, 0 - %or.cond860 = select i1 %92, i1 %93, i1 false - br i1 %or.cond860, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %94 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %94, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %95, ptr %arr_ptr299, align 8 - store ptr %94, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void - -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %95 = tail call ptr @heap_alloc(i64 800) - %96 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %96, i8 -1, i64 16, i1 false) - %97 = tail call ptr @heap_alloc(i64 80) - %98 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %98, align 1 - %99 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %100 = tail call ptr @heap_alloc(i64 80) - %101 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %101, align 1 - br label %__barray_check_bounds.exit.i.i - -102: ; preds = %loop_body.i - %103 = lshr i64 %.fca.2.extract.i.i, 6 - %104 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %.fca.2.extract.i.i, 63 - %107 = sub nuw nsw i64 64, %106 - %108 = lshr i64 -1, %107 - %109 = icmp eq i64 %106, 0 - %110 = select i1 %109, i64 0, i64 %108 - %111 = or i64 %105, %110 - store i64 %111, ptr %104, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %112 = lshr i64 %last_valid.i.i.i, 6 - %113 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %112 - %114 = load i64, ptr %113, align 4 - %115 = and i64 %last_valid.i.i.i, 63 - %116 = shl nsw i64 -2, %115 - %117 = icmp eq i64 %115, 63 - %118 = select i1 %117, i64 0, i64 %116 - %119 = or i64 %114, %118 - store i64 %119, ptr %113, align 4 - %reass.sub.i.i.i = sub nsw i64 %112, %103 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -120: ; preds = %mask_block_ok.i.i.i - %121 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %102, %120 - %.02.i.i.i = phi i64 [ %121, %120 ], [ 0, %102 ] - %gep.i.i.i = getelementptr i64, ptr %104, i64 %.02.i.i.i - %122 = load i64, ptr %gep.i.i.i, align 4 - %123 = icmp eq i64 %122, -1 - br i1 %123, label %120, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %124, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %99, %cond_exit_161 ], [ %139, %loop_body.i ] - %124 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %125 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %126 = lshr i64 %125, 6 - %127 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %126 - %128 = load i64, ptr %127, align 4 - %129 = and i64 %125, 63 - %130 = lshr i64 %128, %129 - %131 = trunc i64 %130 to i1 - br i1 %131, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %132 = shl nuw i64 1, %129 - %133 = xor i64 %132, %128 - store i64 %133, ptr %127, align 4 - %134 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %125 - %135 = load i64, ptr %134, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %135) - tail call void @___qfree(i64 %135) - %136 = load i64, ptr %101, align 4 - %137 = lshr i64 %136, %"313_0.sroa.15.0178.i" - %138 = trunc i64 %137 to i1 - br i1 %138, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %139 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %124, 1 - %140 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %141 = xor i64 %136, %140 - store i64 %141, ptr %101, align 4 - %142 = getelementptr inbounds nuw i64, ptr %100, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %142, align 4 - %143 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %143, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %143, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %143, 2 - %exitcond.not.i792 = icmp eq i64 %124, 10 - br i1 %exitcond.not.i792, label %102, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %120, %102 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %100, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %101, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %144 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %145 = tail call ptr @heap_alloc(i64 10) - %146 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %146, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %295, 0 - %147 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %148 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %147 - %149 = load i64, ptr %148, align 4 - %150 = and i64 %"627_1.sroa.10.0.i.i", 63 - %151 = lshr i64 %149, %150 - %152 = trunc i64 %151 to i1 - br i1 %152, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %153 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %295, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %154, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %144, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %291, %loop_body.i796 ] - %154 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %155 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %156 = lshr i64 %155, 6 - %157 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %156 - %158 = load i64, ptr %157, align 4 - %159 = and i64 %155, 63 - %160 = lshr i64 %158, %159 - %161 = trunc i64 %160 to i1 - br i1 %161, label %panic.i.i.i808, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i808: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %162 = shl nuw i64 1, %159 - %163 = xor i64 %162, %158 - store i64 %163, ptr %157, align 4 - %164 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %155 - %165 = load i64, ptr %164, align 4 - tail call void @___inc_future_refcount(i64 %165) - %166 = load i64, ptr %157, align 4 - %167 = lshr i64 %166, %159 - %168 = trunc i64 %167 to i1 - br i1 %168, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -169: ; preds = %mask_block_ok.i.i.i800 - %170 = add nuw i64 %.02.i.i.i801, 1 - %exitcond.not.i.i.i804 = icmp eq i64 %.02.i.i.i801, %reass.sub.i.i.i798 - br i1 %exitcond.not.i.i.i804, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -mask_block_ok.i.i.i800: ; preds = %cond_exit_630.thread.9.i.i, %169 - %.02.i.i.i801 = phi i64 [ %170, %169 ], [ 0, %cond_exit_630.thread.9.i.i ] - %gep.i.i.i802 = getelementptr i64, ptr %148, i64 %.02.i.i.i801 - %171 = load i64, ptr %gep.i.i.i802, align 4 - %172 = icmp eq i64 %171, -1 - br i1 %172, label %169, label %mask_block_err.i.i.i803 - -mask_block_err.i.i.i803: ; preds = %mask_block_ok.i.i.i800 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader.i.i - %173 = shl nuw i64 1, %150 - %174 = xor i64 %149, %173 - store i64 %174, ptr %148, align 4 - %175 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %"627_1.sroa.10.0.i.i" - %176 = load i64, ptr %175, align 4 - tail call void @___dec_future_refcount(i64 %176) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %177 = add i64 %"627_1.sroa.10.0.i.i", 1 - %178 = lshr i64 %177, 6 - %179 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %178 - %180 = load i64, ptr %179, align 4 - %181 = and i64 %177, 63 - %182 = lshr i64 %180, %181 - %183 = trunc i64 %182 to i1 - br i1 %183, label %cond_exit_630.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i - -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_630.thread.i.i - %184 = shl nuw i64 1, %181 - %185 = xor i64 %180, %184 - store i64 %185, ptr %179, align 4 - %186 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %177 - %187 = load i64, ptr %186, align 4 - tail call void @___dec_future_refcount(i64 %187) - br label %cond_exit_630.thread.1.i.i - -cond_exit_630.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_630.thread.i.i - %188 = add i64 %"627_1.sroa.10.0.i.i", 2 - %189 = lshr i64 %188, 6 - %190 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %189 - %191 = load i64, ptr %190, align 4 - %192 = and i64 %188, 63 - %193 = lshr i64 %191, %192 - %194 = trunc i64 %193 to i1 - br i1 %194, label %cond_exit_630.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i - -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_630.thread.1.i.i - %195 = shl nuw i64 1, %192 - %196 = xor i64 %191, %195 - store i64 %196, ptr %190, align 4 - %197 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %188 - %198 = load i64, ptr %197, align 4 - tail call void @___dec_future_refcount(i64 %198) - br label %cond_exit_630.thread.2.i.i - -cond_exit_630.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_630.thread.1.i.i - %199 = add i64 %"627_1.sroa.10.0.i.i", 3 - %200 = lshr i64 %199, 6 - %201 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %200 - %202 = load i64, ptr %201, align 4 - %203 = and i64 %199, 63 - %204 = lshr i64 %202, %203 - %205 = trunc i64 %204 to i1 - br i1 %205, label %cond_exit_630.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i - -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_630.thread.2.i.i - %206 = shl nuw i64 1, %203 - %207 = xor i64 %202, %206 - store i64 %207, ptr %201, align 4 - %208 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %199 - %209 = load i64, ptr %208, align 4 - tail call void @___dec_future_refcount(i64 %209) - br label %cond_exit_630.thread.3.i.i - -cond_exit_630.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_630.thread.2.i.i - %210 = add i64 %"627_1.sroa.10.0.i.i", 4 - %211 = lshr i64 %210, 6 - %212 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %211 - %213 = load i64, ptr %212, align 4 - %214 = and i64 %210, 63 - %215 = lshr i64 %213, %214 - %216 = trunc i64 %215 to i1 - br i1 %216, label %cond_exit_630.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i - -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_630.thread.3.i.i - %217 = shl nuw i64 1, %214 - %218 = xor i64 %213, %217 - store i64 %218, ptr %212, align 4 - %219 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %210 - %220 = load i64, ptr %219, align 4 - tail call void @___dec_future_refcount(i64 %220) - br label %cond_exit_630.thread.4.i.i - -cond_exit_630.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_630.thread.3.i.i - %221 = add i64 %"627_1.sroa.10.0.i.i", 5 - %222 = lshr i64 %221, 6 - %223 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %222 - %224 = load i64, ptr %223, align 4 - %225 = and i64 %221, 63 - %226 = lshr i64 %224, %225 - %227 = trunc i64 %226 to i1 - br i1 %227, label %cond_exit_630.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i - -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_630.thread.4.i.i - %228 = shl nuw i64 1, %225 - %229 = xor i64 %224, %228 - store i64 %229, ptr %223, align 4 - %230 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %221 - %231 = load i64, ptr %230, align 4 - tail call void @___dec_future_refcount(i64 %231) - br label %cond_exit_630.thread.5.i.i - -cond_exit_630.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_630.thread.4.i.i - %232 = add i64 %"627_1.sroa.10.0.i.i", 6 - %233 = lshr i64 %232, 6 - %234 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %233 - %235 = load i64, ptr %234, align 4 - %236 = and i64 %232, 63 - %237 = lshr i64 %235, %236 - %238 = trunc i64 %237 to i1 - br i1 %238, label %cond_exit_630.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i - -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_630.thread.5.i.i - %239 = shl nuw i64 1, %236 - %240 = xor i64 %235, %239 - store i64 %240, ptr %234, align 4 - %241 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %232 - %242 = load i64, ptr %241, align 4 - tail call void @___dec_future_refcount(i64 %242) - br label %cond_exit_630.thread.6.i.i - -cond_exit_630.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_630.thread.5.i.i - %243 = add i64 %"627_1.sroa.10.0.i.i", 7 - %244 = lshr i64 %243, 6 - %245 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %244 - %246 = load i64, ptr %245, align 4 - %247 = and i64 %243, 63 - %248 = lshr i64 %246, %247 - %249 = trunc i64 %248 to i1 - br i1 %249, label %cond_exit_630.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i - -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_630.thread.6.i.i - %250 = shl nuw i64 1, %247 - %251 = xor i64 %246, %250 - store i64 %251, ptr %245, align 4 - %252 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %243 - %253 = load i64, ptr %252, align 4 - tail call void @___dec_future_refcount(i64 %253) - br label %cond_exit_630.thread.7.i.i - -cond_exit_630.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_630.thread.6.i.i - %254 = add i64 %"627_1.sroa.10.0.i.i", 8 - %255 = lshr i64 %254, 6 - %256 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %255 - %257 = load i64, ptr %256, align 4 - %258 = and i64 %254, 63 - %259 = lshr i64 %257, %258 - %260 = trunc i64 %259 to i1 - br i1 %260, label %cond_exit_630.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i - -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_630.thread.7.i.i - %261 = shl nuw i64 1, %258 - %262 = xor i64 %257, %261 - store i64 %262, ptr %256, align 4 - %263 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %254 - %264 = load i64, ptr %263, align 4 - tail call void @___dec_future_refcount(i64 %264) - br label %cond_exit_630.thread.8.i.i - -cond_exit_630.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_630.thread.7.i.i - %265 = add i64 %"627_1.sroa.10.0.i.i", 9 - %266 = lshr i64 %265, 6 - %267 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %266 - %268 = load i64, ptr %267, align 4 - %269 = and i64 %265, 63 - %270 = lshr i64 %268, %269 - %271 = trunc i64 %270 to i1 - br i1 %271, label %cond_exit_630.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i - -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_630.thread.8.i.i - %272 = shl nuw i64 1, %269 - %273 = xor i64 %268, %272 - store i64 %273, ptr %267, align 4 - %274 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %265 - %275 = load i64, ptr %274, align 4 - tail call void @___dec_future_refcount(i64 %275) - br label %cond_exit_630.thread.9.i.i - -cond_exit_630.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_630.thread.8.i.i - %276 = load i64, ptr %148, align 4 - %277 = sub nuw nsw i64 64, %150 - %278 = lshr i64 -1, %277 - %279 = icmp eq i64 %150, 0 - %280 = select i1 %279, i64 0, i64 %278 - %281 = or i64 %276, %280 - store i64 %281, ptr %148, align 4 - %282 = load i64, ptr %267, align 4 - %283 = shl nsw i64 -2, %269 - %284 = icmp eq i64 %269, 63 - %285 = select i1 %284, i64 0, i64 %283 - %286 = or i64 %282, %285 - store i64 %286, ptr %267, align 4 - %reass.sub.i.i.i798 = sub nsw i64 %266, %147 - %.not.i.i.i799 = icmp eq i64 %reass.sub.i.i.i798, -1 - br i1 %.not.i.i.i799, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i800 - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %287 = xor i64 %166, %162 - store i64 %287, ptr %157, align 4 - store i64 %165, ptr %164, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %165) - tail call void @___dec_future_refcount(i64 %165) - %288 = load i64, ptr %146, align 4 - %289 = lshr i64 %288, %"354_0.sroa.15.0168.i" - %290 = trunc i64 %289 to i1 - br i1 %290, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %291 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %154, 1 - %292 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %293 = xor i64 %288, %292 - store i64 %293, ptr %146, align 4 - %294 = getelementptr inbounds nuw i1, ptr %145, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %294, align 1 - %295 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %154, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %169, %cond_exit_630.thread.9.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %296 = load i64, ptr %146, align 4 - %297 = and i64 %296, 1023 - store i64 %297, ptr %146, align 4 - %298 = icmp eq i64 %297, 0 - br i1 %298, label %__barray_check_none_borrowed.exit813, label %mask_block_err.i811 - -__barray_check_none_borrowed.exit813: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %299 = tail call ptr @heap_alloc(i64 10) - %300 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %300, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %299, ptr noundef nonnull align 1 dereferenceable(10) %145, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %299) - %301 = load i64, ptr %146, align 4 - %302 = and i64 %301, 1023 - store i64 %302, ptr %146, align 4 - %303 = icmp eq i64 %302, 0 - br i1 %303, label %__barray_check_none_borrowed.exit818, label %mask_block_err.i816 - -mask_block_err.i811: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit818: ; preds = %__barray_check_none_borrowed.exit813 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %304 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %304, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %145, ptr %arr_ptr, align 8 - store ptr %304, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i816: ; preds = %__barray_check_none_borrowed.exit813 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %156, %cond_exit_366 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 63 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = add nuw nsw i64 %"362_2.01892", 1 + %157 = shl nuw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %exitcond1897 = icmp eq i64 %156, 100 + br i1 %exitcond1897, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366 + %160 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %161 = load i64, ptr %160, align 4 + %162 = and i64 %161, 68719476735 + store i64 %162, ptr %160, align 4 + %163 = load i64, ptr %5, align 4 + %164 = icmp eq i64 %163, 0 + %165 = icmp eq i64 %162, 0 + %or.cond = select i1 %164, i1 %165, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %166 = call ptr @heap_alloc(i64 800) + %167 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %167, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %166, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %166) + %168 = load i64, ptr %160, align 4 + %169 = and i64 %168, 68719476735 + store i64 %169, ptr %160, align 4 + %170 = load i64, ptr %5, align 4 + %171 = icmp eq i64 %170, 0 + %172 = icmp eq i64 %169, 0 + %or.cond1902 = select i1 %171, i1 %172, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %173 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %173, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %173, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -837,26 +589,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-apple-darwin.ll index ceac2110..e5610fd2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-apple-darwin.ll @@ -3,691 +3,597 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_sol_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__barray_check_bounds.exit.2 - -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not857 = icmp eq i64 %10, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__barray_check_bounds.exit.3 - -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not858 = icmp eq i64 %14, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__barray_check_bounds.exit.4 - -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not859 = icmp eq i64 %18, 0 - br i1 %.not859, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__barray_check_bounds.exit.5 - -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not860 = icmp eq i64 %22, 0 - br i1 %.not860, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__barray_check_bounds.exit.6 - -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not861 = icmp eq i64 %26, 0 - br i1 %.not861, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not862 = icmp eq i64 %30, 0 - br i1 %.not862, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__barray_check_bounds.exit.8 - -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not863 = icmp eq i64 %34, 0 - br i1 %.not863, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not864 = icmp eq i64 %38, 0 - br i1 %.not864, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0843" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0843", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0843" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0843" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0843" - %48 = load i64, ptr %47, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0843" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond850.not = icmp eq i64 %41, 10 - br i1 %exitcond850.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit819 - %"84_0.sroa.0.0845" = phi i64 [ 0, %__barray_check_none_borrowed.exit819 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0845", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0845", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %108, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0845" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0845" - %60 = xor i64 %55, %59 - store i64 %60, ptr %108, align 4 - %61 = getelementptr inbounds nuw double, ptr %107, i64 %"84_0.sroa.0.0845" - store double %58, ptr %61, align 8 - %exitcond851.not = icmp eq i64 %53, 10 - br i1 %exitcond851.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %108, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %108, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %107, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %108, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %108, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %107, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131.1, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0847" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %87, %cond_exit_131.1 ] - %71 = lshr i64 %"126_0.sroa.0.0847", 6 - %72 = getelementptr inbounds nuw i64, ptr %106, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0847", 62 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %cond_exit_131, %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = or disjoint i64 %"126_0.sroa.0.0847", 1 - %78 = shl nuw nsw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %105, i64 %"126_0.sroa.0.0847" - store i64 %"126_0.sroa.0.0847", ptr %80, align 4 - %81 = lshr i64 %"126_0.sroa.0.0847", 6 - %82 = getelementptr inbounds nuw i64, ptr %106, i64 %81 - %83 = load i64, ptr %82, align 4 - %84 = and i64 %77, 63 - %85 = lshr i64 %83, %84 - %86 = trunc i64 %85 to i1 - br i1 %86, label %cond_exit_131.1, label %panic.i780 - -cond_exit_131.1: ; preds = %cond_exit_131 - %87 = add nuw nsw i64 %"126_0.sroa.0.0847", 2 - %88 = shl nuw i64 1, %84 - %89 = xor i64 %83, %88 - store i64 %89, ptr %82, align 4 - %90 = getelementptr inbounds nuw i64, ptr %105, i64 %77 - store i64 %77, ptr %90, align 4 - %exitcond852.not.1 = icmp eq i64 %87, 100 - br i1 %exitcond852.not.1, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131.1 - %91 = getelementptr inbounds nuw i8, ptr %106, i64 8 - %92 = load i64, ptr %91, align 4 - %93 = and i64 %92, 68719476735 - store i64 %93, ptr %91, align 4 - %94 = load i64, ptr %106, align 4 - %95 = icmp eq i64 %94, 0 - %96 = icmp eq i64 %93, 0 - %or.cond = select i1 %95, i1 %96, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %97 = call ptr @heap_alloc(i64 800) - %98 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %98, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %97, ptr noundef nonnull align 1 dereferenceable(800) %105, i64 800, i1 false) - call void @heap_free(ptr nonnull %97) - %99 = load i64, ptr %91, align 4 - %100 = and i64 %99, 68719476735 - store i64 %100, ptr %91, align 4 - %101 = load i64, ptr %106, align 4 - %102 = icmp eq i64 %101, 0 - %103 = icmp eq i64 %100, 0 - %or.cond854 = select i1 %102, i1 %103, i1 false - br i1 %or.cond854, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %104 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %104, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %105, ptr %arr_ptr299, align 8 - store ptr %104, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %105 = tail call ptr @heap_alloc(i64 800) - %106 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %106, i8 -1, i64 16, i1 false) - %107 = tail call ptr @heap_alloc(i64 80) - %108 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %108, align 1 - %109 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %110 = tail call ptr @heap_alloc(i64 80) - %111 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %111, align 1 - br label %__barray_check_bounds.exit.i.i - -112: ; preds = %loop_body.i - %113 = lshr i64 %.fca.2.extract.i.i, 6 - %114 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %113 - %115 = load i64, ptr %114, align 4 - %116 = and i64 %.fca.2.extract.i.i, 63 - %117 = sub nuw nsw i64 64, %116 - %118 = lshr i64 -1, %117 - %119 = icmp eq i64 %116, 0 - %120 = select i1 %119, i64 0, i64 %118 - %121 = or i64 %115, %120 - store i64 %121, ptr %114, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %122 = lshr i64 %last_valid.i.i.i, 6 - %123 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %122 - %124 = load i64, ptr %123, align 4 - %125 = and i64 %last_valid.i.i.i, 63 - %126 = shl nsw i64 -2, %125 - %127 = icmp eq i64 %125, 63 - %128 = select i1 %127, i64 0, i64 %126 - %129 = or i64 %124, %128 - store i64 %129, ptr %123, align 4 - %reass.sub.i.i.i = sub nsw i64 %122, %113 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -130: ; preds = %mask_block_ok.i.i.i - %131 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %112, %130 - %.02.i.i.i = phi i64 [ %131, %130 ], [ 0, %112 ] - %gep.i.i.i = getelementptr i64, ptr %114, i64 %.02.i.i.i - %132 = load i64, ptr %gep.i.i.i, align 4 - %133 = icmp eq i64 %132, -1 - br i1 %133, label %130, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %134, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %109, %cond_exit_161 ], [ %149, %loop_body.i ] - %134 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %135 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %136 = lshr i64 %135, 6 - %137 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %136 - %138 = load i64, ptr %137, align 4 - %139 = and i64 %135, 63 - %140 = lshr i64 %138, %139 - %141 = trunc i64 %140 to i1 - br i1 %141, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %142 = shl nuw i64 1, %139 - %143 = xor i64 %142, %138 - store i64 %143, ptr %137, align 4 - %144 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %135 - %145 = load i64, ptr %144, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %145) - tail call void @___qfree(i64 %145) - %146 = load i64, ptr %111, align 4 - %147 = lshr i64 %146, %"313_0.sroa.15.0178.i" - %148 = trunc i64 %147 to i1 - br i1 %148, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %149 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %134, 1 - %150 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %151 = xor i64 %146, %150 - store i64 %151, ptr %111, align 4 - %152 = getelementptr inbounds nuw i64, ptr %110, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %152, align 4 - %153 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %exitcond.not.i792 = icmp eq i64 %134, 10 - br i1 %exitcond.not.i792, label %112, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %130, %112 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %110, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %111, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %154 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %155 = tail call ptr @heap_alloc(i64 10) - %156 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %156, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %157 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %214, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %158, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %154, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %210, %loop_body.i796 ] - %158 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %157, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %157, 1 - %159 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %panic.i.i.i809, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i809: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %157, 0 - %166 = shl nuw i64 1, %163 - %167 = xor i64 %166, %162 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___inc_future_refcount(i64 %169) - %170 = load i64, ptr %161, align 4 - %171 = lshr i64 %170, %163 - %172 = trunc i64 %171 to i1 - br i1 %172, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_630_case_0.i.i: ; preds = %cond_exit_630.thread.i.i - %173 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %174 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %173 - %175 = load i64, ptr %174, align 4 - %176 = and i64 %"627_1.sroa.10.0.i.i", 63 - %177 = sub nuw nsw i64 64, %176 - %178 = lshr i64 -1, %177 - %179 = icmp eq i64 %176, 0 - %180 = select i1 %179, i64 0, i64 %178 - %181 = or i64 %175, %180 - store i64 %181, ptr %174, align 4 - %last_valid.i.i.i798 = add i64 %"627_1.sroa.10.0.i.i", 9 - %182 = lshr i64 %last_valid.i.i.i798, 6 - %183 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %last_valid.i.i.i798, 63 - %186 = shl nsw i64 -2, %185 - %187 = icmp eq i64 %185, 63 - %188 = select i1 %187, i64 0, i64 %186 - %189 = or i64 %184, %188 - store i64 %189, ptr %183, align 4 - %reass.sub.i.i.i799 = sub nsw i64 %182, %173 - %.not.i.i.i800 = icmp eq i64 %reass.sub.i.i.i799, -1 - br i1 %.not.i.i.i800, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -190: ; preds = %mask_block_ok.i.i.i801 - %191 = add nuw i64 %.02.i.i.i802, 1 - %exitcond.not.i.i.i805 = icmp eq i64 %.02.i.i.i802, %reass.sub.i.i.i799 - br i1 %exitcond.not.i.i.i805, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -mask_block_ok.i.i.i801: ; preds = %cond_630_case_0.i.i, %190 - %.02.i.i.i802 = phi i64 [ %191, %190 ], [ 0, %cond_630_case_0.i.i ] - %gep.i.i.i803 = getelementptr i64, ptr %174, i64 %.02.i.i.i802 - %192 = load i64, ptr %gep.i.i.i803, align 4 - %193 = icmp eq i64 %192, -1 - br i1 %193, label %190, label %mask_block_err.i.i.i804 - -mask_block_err.i.i.i804: ; preds = %mask_block_ok.i.i.i801 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_630.thread.i.i, %loop_body.preheader.i.i - %"627_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %194, %cond_exit_630.thread.i.i ] - %194 = add nuw nsw i64 %"627_0.0239.i.i", 1 - %195 = add i64 %"627_0.0239.i.i", %"627_1.sroa.10.0.i.i" - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %202, %198 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %194, 10 - br i1 %exitcond.i.i, label %cond_630_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %206 = xor i64 %170, %166 - store i64 %206, ptr %161, align 4 - store i64 %169, ptr %168, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %169) - tail call void @___dec_future_refcount(i64 %169) - %207 = load i64, ptr %156, align 4 - %208 = lshr i64 %207, %"354_0.sroa.15.0168.i" - %209 = trunc i64 %208 to i1 - br i1 %209, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %210 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %158, 1 - %211 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %212 = xor i64 %207, %211 - store i64 %212, ptr %156, align 4 - %213 = getelementptr inbounds nuw i1, ptr %155, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %213, align 1 - %214 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %158, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %190, %cond_630_case_0.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %215 = load i64, ptr %156, align 4 - %216 = and i64 %215, 1023 - store i64 %216, ptr %156, align 4 - %217 = icmp eq i64 %216, 0 - br i1 %217, label %__barray_check_none_borrowed.exit814, label %mask_block_err.i812 - -__barray_check_none_borrowed.exit814: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %218 = tail call ptr @heap_alloc(i64 10) - %219 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %219, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %218, ptr noundef nonnull align 1 dereferenceable(10) %155, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %218) - %220 = load i64, ptr %156, align 4 - %221 = and i64 %220, 1023 - store i64 %221, ptr %156, align 4 - %222 = icmp eq i64 %221, 0 - br i1 %222, label %__barray_check_none_borrowed.exit819, label %mask_block_err.i817 - -mask_block_err.i812: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit819: ; preds = %__barray_check_none_borrowed.exit814 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %223 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %223, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %155, ptr %arr_ptr, align 8 - store ptr %223, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i817: ; preds = %__barray_check_none_borrowed.exit814 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366.1, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %166, %cond_exit_366.1 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 62 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %cond_exit_366, %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = or disjoint i64 %"362_2.01892", 1 + %157 = shl nuw nsw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %160 = lshr i64 %"362_2.01892", 6 + %161 = getelementptr inbounds nuw i64, ptr %5, i64 %160 + %162 = load i64, ptr %161, align 4 + %163 = and i64 %156, 63 + %164 = lshr i64 %162, %163 + %165 = trunc i64 %164 to i1 + br i1 %165, label %cond_exit_366.1, label %panic.i1857 + +cond_exit_366.1: ; preds = %cond_exit_366 + %166 = add nuw nsw i64 %"362_2.01892", 2 + %167 = shl nuw i64 1, %163 + %168 = xor i64 %162, %167 + store i64 %168, ptr %161, align 4 + %169 = getelementptr inbounds nuw i64, ptr %4, i64 %156 + store i64 %156, ptr %169, align 4 + %exitcond1897.1 = icmp eq i64 %166, 100 + br i1 %exitcond1897.1, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366.1 + %170 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %171 = load i64, ptr %170, align 4 + %172 = and i64 %171, 68719476735 + store i64 %172, ptr %170, align 4 + %173 = load i64, ptr %5, align 4 + %174 = icmp eq i64 %173, 0 + %175 = icmp eq i64 %172, 0 + %or.cond = select i1 %174, i1 %175, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %176 = call ptr @heap_alloc(i64 800) + %177 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %177, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %176, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %176) + %178 = load i64, ptr %170, align 4 + %179 = and i64 %178, 68719476735 + store i64 %179, ptr %170, align 4 + %180 = load i64, ptr %5, align 4 + %181 = icmp eq i64 %180, 0 + %182 = icmp eq i64 %179, 0 + %or.cond1902 = select i1 %181, i1 %182, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %183 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %183, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %183, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -698,26 +604,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-unknown-linux-gnu.ll index e1cd9e2c..5d7de4da 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-unknown-linux-gnu.ll @@ -3,691 +3,597 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_sol_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__barray_check_bounds.exit.2 - -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not857 = icmp eq i64 %10, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__barray_check_bounds.exit.3 - -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not858 = icmp eq i64 %14, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__barray_check_bounds.exit.4 - -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not859 = icmp eq i64 %18, 0 - br i1 %.not859, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__barray_check_bounds.exit.5 - -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not860 = icmp eq i64 %22, 0 - br i1 %.not860, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__barray_check_bounds.exit.6 - -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not861 = icmp eq i64 %26, 0 - br i1 %.not861, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not862 = icmp eq i64 %30, 0 - br i1 %.not862, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__barray_check_bounds.exit.8 - -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not863 = icmp eq i64 %34, 0 - br i1 %.not863, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not864 = icmp eq i64 %38, 0 - br i1 %.not864, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0843" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0843", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0843" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0843" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0843" - %48 = load i64, ptr %47, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0843" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond850.not = icmp eq i64 %41, 10 - br i1 %exitcond850.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit819 - %"84_0.sroa.0.0845" = phi i64 [ 0, %__barray_check_none_borrowed.exit819 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0845", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0845", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %108, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0845" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0845" - %60 = xor i64 %55, %59 - store i64 %60, ptr %108, align 4 - %61 = getelementptr inbounds nuw double, ptr %107, i64 %"84_0.sroa.0.0845" - store double %58, ptr %61, align 8 - %exitcond851.not = icmp eq i64 %53, 10 - br i1 %exitcond851.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %108, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %108, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %107, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %108, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %108, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %107, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131.1, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0847" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %87, %cond_exit_131.1 ] - %71 = lshr i64 %"126_0.sroa.0.0847", 6 - %72 = getelementptr inbounds nuw i64, ptr %106, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0847", 62 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %cond_exit_131, %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = or disjoint i64 %"126_0.sroa.0.0847", 1 - %78 = shl nuw nsw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %105, i64 %"126_0.sroa.0.0847" - store i64 %"126_0.sroa.0.0847", ptr %80, align 4 - %81 = lshr i64 %"126_0.sroa.0.0847", 6 - %82 = getelementptr inbounds nuw i64, ptr %106, i64 %81 - %83 = load i64, ptr %82, align 4 - %84 = and i64 %77, 63 - %85 = lshr i64 %83, %84 - %86 = trunc i64 %85 to i1 - br i1 %86, label %cond_exit_131.1, label %panic.i780 - -cond_exit_131.1: ; preds = %cond_exit_131 - %87 = add nuw nsw i64 %"126_0.sroa.0.0847", 2 - %88 = shl nuw i64 1, %84 - %89 = xor i64 %83, %88 - store i64 %89, ptr %82, align 4 - %90 = getelementptr inbounds nuw i64, ptr %105, i64 %77 - store i64 %77, ptr %90, align 4 - %exitcond852.not.1 = icmp eq i64 %87, 100 - br i1 %exitcond852.not.1, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131.1 - %91 = getelementptr inbounds nuw i8, ptr %106, i64 8 - %92 = load i64, ptr %91, align 4 - %93 = and i64 %92, 68719476735 - store i64 %93, ptr %91, align 4 - %94 = load i64, ptr %106, align 4 - %95 = icmp eq i64 %94, 0 - %96 = icmp eq i64 %93, 0 - %or.cond = select i1 %95, i1 %96, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %97 = call ptr @heap_alloc(i64 800) - %98 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %98, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %97, ptr noundef nonnull align 1 dereferenceable(800) %105, i64 800, i1 false) - call void @heap_free(ptr nonnull %97) - %99 = load i64, ptr %91, align 4 - %100 = and i64 %99, 68719476735 - store i64 %100, ptr %91, align 4 - %101 = load i64, ptr %106, align 4 - %102 = icmp eq i64 %101, 0 - %103 = icmp eq i64 %100, 0 - %or.cond854 = select i1 %102, i1 %103, i1 false - br i1 %or.cond854, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %104 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %104, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %105, ptr %arr_ptr299, align 8 - store ptr %104, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %105 = tail call ptr @heap_alloc(i64 800) - %106 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %106, i8 -1, i64 16, i1 false) - %107 = tail call ptr @heap_alloc(i64 80) - %108 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %108, align 1 - %109 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %110 = tail call ptr @heap_alloc(i64 80) - %111 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %111, align 1 - br label %__barray_check_bounds.exit.i.i - -112: ; preds = %loop_body.i - %113 = lshr i64 %.fca.2.extract.i.i, 6 - %114 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %113 - %115 = load i64, ptr %114, align 4 - %116 = and i64 %.fca.2.extract.i.i, 63 - %117 = sub nuw nsw i64 64, %116 - %118 = lshr i64 -1, %117 - %119 = icmp eq i64 %116, 0 - %120 = select i1 %119, i64 0, i64 %118 - %121 = or i64 %115, %120 - store i64 %121, ptr %114, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %122 = lshr i64 %last_valid.i.i.i, 6 - %123 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %122 - %124 = load i64, ptr %123, align 4 - %125 = and i64 %last_valid.i.i.i, 63 - %126 = shl nsw i64 -2, %125 - %127 = icmp eq i64 %125, 63 - %128 = select i1 %127, i64 0, i64 %126 - %129 = or i64 %124, %128 - store i64 %129, ptr %123, align 4 - %reass.sub.i.i.i = sub nsw i64 %122, %113 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -130: ; preds = %mask_block_ok.i.i.i - %131 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %112, %130 - %.02.i.i.i = phi i64 [ %131, %130 ], [ 0, %112 ] - %gep.i.i.i = getelementptr i64, ptr %114, i64 %.02.i.i.i - %132 = load i64, ptr %gep.i.i.i, align 4 - %133 = icmp eq i64 %132, -1 - br i1 %133, label %130, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %134, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %109, %cond_exit_161 ], [ %149, %loop_body.i ] - %134 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %135 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %136 = lshr i64 %135, 6 - %137 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %136 - %138 = load i64, ptr %137, align 4 - %139 = and i64 %135, 63 - %140 = lshr i64 %138, %139 - %141 = trunc i64 %140 to i1 - br i1 %141, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %142 = shl nuw i64 1, %139 - %143 = xor i64 %142, %138 - store i64 %143, ptr %137, align 4 - %144 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %135 - %145 = load i64, ptr %144, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %145) - tail call void @___qfree(i64 %145) - %146 = load i64, ptr %111, align 4 - %147 = lshr i64 %146, %"313_0.sroa.15.0178.i" - %148 = trunc i64 %147 to i1 - br i1 %148, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %149 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %134, 1 - %150 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %151 = xor i64 %146, %150 - store i64 %151, ptr %111, align 4 - %152 = getelementptr inbounds nuw i64, ptr %110, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %152, align 4 - %153 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %exitcond.not.i792 = icmp eq i64 %134, 10 - br i1 %exitcond.not.i792, label %112, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %130, %112 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %110, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %111, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %154 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %155 = tail call ptr @heap_alloc(i64 10) - %156 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %156, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %157 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %214, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %158, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %154, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %210, %loop_body.i796 ] - %158 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %157, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %157, 1 - %159 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %panic.i.i.i809, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i809: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %157, 0 - %166 = shl nuw i64 1, %163 - %167 = xor i64 %166, %162 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___inc_future_refcount(i64 %169) - %170 = load i64, ptr %161, align 4 - %171 = lshr i64 %170, %163 - %172 = trunc i64 %171 to i1 - br i1 %172, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_630_case_0.i.i: ; preds = %cond_exit_630.thread.i.i - %173 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %174 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %173 - %175 = load i64, ptr %174, align 4 - %176 = and i64 %"627_1.sroa.10.0.i.i", 63 - %177 = sub nuw nsw i64 64, %176 - %178 = lshr i64 -1, %177 - %179 = icmp eq i64 %176, 0 - %180 = select i1 %179, i64 0, i64 %178 - %181 = or i64 %175, %180 - store i64 %181, ptr %174, align 4 - %last_valid.i.i.i798 = add i64 %"627_1.sroa.10.0.i.i", 9 - %182 = lshr i64 %last_valid.i.i.i798, 6 - %183 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %last_valid.i.i.i798, 63 - %186 = shl nsw i64 -2, %185 - %187 = icmp eq i64 %185, 63 - %188 = select i1 %187, i64 0, i64 %186 - %189 = or i64 %184, %188 - store i64 %189, ptr %183, align 4 - %reass.sub.i.i.i799 = sub nsw i64 %182, %173 - %.not.i.i.i800 = icmp eq i64 %reass.sub.i.i.i799, -1 - br i1 %.not.i.i.i800, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -190: ; preds = %mask_block_ok.i.i.i801 - %191 = add nuw i64 %.02.i.i.i802, 1 - %exitcond.not.i.i.i805 = icmp eq i64 %.02.i.i.i802, %reass.sub.i.i.i799 - br i1 %exitcond.not.i.i.i805, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -mask_block_ok.i.i.i801: ; preds = %cond_630_case_0.i.i, %190 - %.02.i.i.i802 = phi i64 [ %191, %190 ], [ 0, %cond_630_case_0.i.i ] - %gep.i.i.i803 = getelementptr i64, ptr %174, i64 %.02.i.i.i802 - %192 = load i64, ptr %gep.i.i.i803, align 4 - %193 = icmp eq i64 %192, -1 - br i1 %193, label %190, label %mask_block_err.i.i.i804 - -mask_block_err.i.i.i804: ; preds = %mask_block_ok.i.i.i801 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_630.thread.i.i, %loop_body.preheader.i.i - %"627_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %194, %cond_exit_630.thread.i.i ] - %194 = add nuw nsw i64 %"627_0.0239.i.i", 1 - %195 = add i64 %"627_0.0239.i.i", %"627_1.sroa.10.0.i.i" - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %202, %198 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %194, 10 - br i1 %exitcond.i.i, label %cond_630_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %206 = xor i64 %170, %166 - store i64 %206, ptr %161, align 4 - store i64 %169, ptr %168, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %169) - tail call void @___dec_future_refcount(i64 %169) - %207 = load i64, ptr %156, align 4 - %208 = lshr i64 %207, %"354_0.sroa.15.0168.i" - %209 = trunc i64 %208 to i1 - br i1 %209, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %210 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %158, 1 - %211 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %212 = xor i64 %207, %211 - store i64 %212, ptr %156, align 4 - %213 = getelementptr inbounds nuw i1, ptr %155, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %213, align 1 - %214 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %158, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %190, %cond_630_case_0.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %215 = load i64, ptr %156, align 4 - %216 = and i64 %215, 1023 - store i64 %216, ptr %156, align 4 - %217 = icmp eq i64 %216, 0 - br i1 %217, label %__barray_check_none_borrowed.exit814, label %mask_block_err.i812 - -__barray_check_none_borrowed.exit814: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %218 = tail call ptr @heap_alloc(i64 10) - %219 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %219, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %218, ptr noundef nonnull align 1 dereferenceable(10) %155, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %218) - %220 = load i64, ptr %156, align 4 - %221 = and i64 %220, 1023 - store i64 %221, ptr %156, align 4 - %222 = icmp eq i64 %221, 0 - br i1 %222, label %__barray_check_none_borrowed.exit819, label %mask_block_err.i817 - -mask_block_err.i812: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit819: ; preds = %__barray_check_none_borrowed.exit814 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %223 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %223, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %155, ptr %arr_ptr, align 8 - store ptr %223, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i817: ; preds = %__barray_check_none_borrowed.exit814 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366.1, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %166, %cond_exit_366.1 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 62 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %cond_exit_366, %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = or disjoint i64 %"362_2.01892", 1 + %157 = shl nuw nsw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %160 = lshr i64 %"362_2.01892", 6 + %161 = getelementptr inbounds nuw i64, ptr %5, i64 %160 + %162 = load i64, ptr %161, align 4 + %163 = and i64 %156, 63 + %164 = lshr i64 %162, %163 + %165 = trunc i64 %164 to i1 + br i1 %165, label %cond_exit_366.1, label %panic.i1857 + +cond_exit_366.1: ; preds = %cond_exit_366 + %166 = add nuw nsw i64 %"362_2.01892", 2 + %167 = shl nuw i64 1, %163 + %168 = xor i64 %162, %167 + store i64 %168, ptr %161, align 4 + %169 = getelementptr inbounds nuw i64, ptr %4, i64 %156 + store i64 %156, ptr %169, align 4 + %exitcond1897.1 = icmp eq i64 %166, 100 + br i1 %exitcond1897.1, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366.1 + %170 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %171 = load i64, ptr %170, align 4 + %172 = and i64 %171, 68719476735 + store i64 %172, ptr %170, align 4 + %173 = load i64, ptr %5, align 4 + %174 = icmp eq i64 %173, 0 + %175 = icmp eq i64 %172, 0 + %or.cond = select i1 %174, i1 %175, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %176 = call ptr @heap_alloc(i64 800) + %177 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %177, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %176, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %176) + %178 = load i64, ptr %170, align 4 + %179 = and i64 %178, 68719476735 + store i64 %179, ptr %170, align 4 + %180 = load i64, ptr %5, align 4 + %181 = icmp eq i64 %180, 0 + %182 = icmp eq i64 %179, 0 + %or.cond1902 = select i1 %181, i1 %182, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %183 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %183, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %183, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -698,26 +604,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-windows-gnu.ll index 7897a0e2..ef184177 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_array_results_unparsed/array_results-sol-x86_64-windows-gnu.ll @@ -3,691 +3,597 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" +@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" +@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" @res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @res_floats.8646C2EF.0 = private constant [21 x i8] c"\14USER:FLOATARR:floats" @res_ints.B3BC9D53.0 = private constant [17 x i8] c"\10USER:INTARR:ints" -@"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" -@"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 80) + %0 = tail call ptr @heap_alloc(i64 10) %1 = tail call ptr @heap_alloc(i64 8) store i64 -1, ptr %1, align 1 + %2 = tail call ptr @heap_alloc(i64 80) + %3 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %3, align 1 + %4 = tail call ptr @heap_alloc(i64 800) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + %6 = tail call ptr @heap_alloc(i64 80) + %7 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %7, align 1 + %8 = tail call ptr @heap_alloc(i64 80) + %9 = tail call ptr @heap_alloc(i64 8) + store i64 -1, ptr %9, align 1 + br label %loop_body + +loop_body: ; preds = %cond_exit_104, %alloca_block + %"100_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_104 ] + %"100_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %11, %cond_exit_104 ] + %10 = icmp samesign ugt i64 %"100_0.sroa.0.0", 9 + %11 = add nuw nsw i64 %"100_0.sroa.0.0", 1 + br i1 %10, label %cond_exit_104, label %cond_104_case_1 + +cond_104_case_1: ; preds = %loop_body + %12 = add i64 %"100_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_607_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_683_case_0.i, label %__hugr__.__tk2_sol_qalloc.679.exit -cond_607_case_0.i: ; preds = %cond_exit_20.8, %cond_exit_20.7, %cond_exit_20.6, %cond_exit_20.5, %cond_exit_20.4, %cond_exit_20.3, %cond_exit_20.2, %cond_exit_20.1, %cond_exit_20, %alloca_block +cond_683_case_0.i: ; preds = %cond_104_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.679.exit: ; preds = %cond_104_case_1 tail call void @___reset(i64 %qalloc.i) - %2 = load i64, ptr %1, align 4 - %3 = trunc i64 %2 to i1 - br i1 %3, label %cond_exit_20, label %panic.i + %13 = icmp ult i64 %"100_2.0", 10 + br i1 %13, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable -panic.i: ; preds = %__barray_check_bounds.exit.9, %__barray_check_bounds.exit.8, %__barray_check_bounds.exit.7, %__barray_check_bounds.exit.6, %__barray_check_bounds.exit.5, %__barray_check_bounds.exit.4, %__barray_check_bounds.exit.3, %__barray_check_bounds.exit.2, %__barray_check_bounds.exit.1, %__barray_check_bounds.exit +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.679.exit + %14 = load i64, ptr %9, align 4 + %15 = lshr i64 %14, %"100_2.0" + %16 = trunc i64 %15 to i1 + br i1 %16, label %__barray_mask_return.exit, label %panic.i + +panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %4 = and i64 %2, -2 - store i64 %4, ptr %1, align 4 - store i64 %qalloc.i, ptr %0, align 4 - %qalloc.i.1 = tail call i64 @___qalloc() - %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1 - br i1 %not_max.not.not.i.1, label %cond_607_case_0.i, label %__barray_check_bounds.exit.1 - -__barray_check_bounds.exit.1: ; preds = %cond_exit_20 - tail call void @___reset(i64 %qalloc.i.1) - %5 = load i64, ptr %1, align 4 - %6 = and i64 %5, 2 - %.not = icmp eq i64 %6, 0 - br i1 %.not, label %panic.i, label %cond_exit_20.1 - -cond_exit_20.1: ; preds = %__barray_check_bounds.exit.1 - %7 = and i64 %5, -3 - store i64 %7, ptr %1, align 4 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 8 - store i64 %qalloc.i.1, ptr %8, align 4 - %qalloc.i.2 = tail call i64 @___qalloc() - %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1 - br i1 %not_max.not.not.i.2, label %cond_607_case_0.i, label %__barray_check_bounds.exit.2 - -__barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 - tail call void @___reset(i64 %qalloc.i.2) - %9 = load i64, ptr %1, align 4 - %10 = and i64 %9, 4 - %.not857 = icmp eq i64 %10, 0 - br i1 %.not857, label %panic.i, label %cond_exit_20.2 - -cond_exit_20.2: ; preds = %__barray_check_bounds.exit.2 - %11 = and i64 %9, -5 - store i64 %11, ptr %1, align 4 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 16 - store i64 %qalloc.i.2, ptr %12, align 4 - %qalloc.i.3 = tail call i64 @___qalloc() - %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1 - br i1 %not_max.not.not.i.3, label %cond_607_case_0.i, label %__barray_check_bounds.exit.3 - -__barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 - tail call void @___reset(i64 %qalloc.i.3) - %13 = load i64, ptr %1, align 4 - %14 = and i64 %13, 8 - %.not858 = icmp eq i64 %14, 0 - br i1 %.not858, label %panic.i, label %cond_exit_20.3 - -cond_exit_20.3: ; preds = %__barray_check_bounds.exit.3 - %15 = and i64 %13, -9 - store i64 %15, ptr %1, align 4 - %16 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i64 %qalloc.i.3, ptr %16, align 4 - %qalloc.i.4 = tail call i64 @___qalloc() - %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1 - br i1 %not_max.not.not.i.4, label %cond_607_case_0.i, label %__barray_check_bounds.exit.4 - -__barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 - tail call void @___reset(i64 %qalloc.i.4) - %17 = load i64, ptr %1, align 4 - %18 = and i64 %17, 16 - %.not859 = icmp eq i64 %18, 0 - br i1 %.not859, label %panic.i, label %cond_exit_20.4 - -cond_exit_20.4: ; preds = %__barray_check_bounds.exit.4 - %19 = and i64 %17, -17 - store i64 %19, ptr %1, align 4 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 32 - store i64 %qalloc.i.4, ptr %20, align 4 - %qalloc.i.5 = tail call i64 @___qalloc() - %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1 - br i1 %not_max.not.not.i.5, label %cond_607_case_0.i, label %__barray_check_bounds.exit.5 - -__barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 - tail call void @___reset(i64 %qalloc.i.5) - %21 = load i64, ptr %1, align 4 - %22 = and i64 %21, 32 - %.not860 = icmp eq i64 %22, 0 - br i1 %.not860, label %panic.i, label %cond_exit_20.5 - -cond_exit_20.5: ; preds = %__barray_check_bounds.exit.5 - %23 = and i64 %21, -33 - store i64 %23, ptr %1, align 4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 40 - store i64 %qalloc.i.5, ptr %24, align 4 - %qalloc.i.6 = tail call i64 @___qalloc() - %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1 - br i1 %not_max.not.not.i.6, label %cond_607_case_0.i, label %__barray_check_bounds.exit.6 - -__barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 - tail call void @___reset(i64 %qalloc.i.6) - %25 = load i64, ptr %1, align 4 - %26 = and i64 %25, 64 - %.not861 = icmp eq i64 %26, 0 - br i1 %.not861, label %panic.i, label %cond_exit_20.6 - -cond_exit_20.6: ; preds = %__barray_check_bounds.exit.6 - %27 = and i64 %25, -65 - store i64 %27, ptr %1, align 4 - %28 = getelementptr inbounds nuw i8, ptr %0, i64 48 - store i64 %qalloc.i.6, ptr %28, align 4 - %qalloc.i.7 = tail call i64 @___qalloc() - %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1 - br i1 %not_max.not.not.i.7, label %cond_607_case_0.i, label %__barray_check_bounds.exit.7 - -__barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 - tail call void @___reset(i64 %qalloc.i.7) - %29 = load i64, ptr %1, align 4 - %30 = and i64 %29, 128 - %.not862 = icmp eq i64 %30, 0 - br i1 %.not862, label %panic.i, label %cond_exit_20.7 - -cond_exit_20.7: ; preds = %__barray_check_bounds.exit.7 - %31 = and i64 %29, -129 - store i64 %31, ptr %1, align 4 - %32 = getelementptr inbounds nuw i8, ptr %0, i64 56 - store i64 %qalloc.i.7, ptr %32, align 4 - %qalloc.i.8 = tail call i64 @___qalloc() - %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1 - br i1 %not_max.not.not.i.8, label %cond_607_case_0.i, label %__barray_check_bounds.exit.8 - -__barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 - tail call void @___reset(i64 %qalloc.i.8) - %33 = load i64, ptr %1, align 4 - %34 = and i64 %33, 256 - %.not863 = icmp eq i64 %34, 0 - br i1 %.not863, label %panic.i, label %cond_exit_20.8 - -cond_exit_20.8: ; preds = %__barray_check_bounds.exit.8 - %35 = and i64 %33, -257 - store i64 %35, ptr %1, align 4 - %36 = getelementptr inbounds nuw i8, ptr %0, i64 64 - store i64 %qalloc.i.8, ptr %36, align 4 - %qalloc.i.9 = tail call i64 @___qalloc() - %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1 - br i1 %not_max.not.not.i.9, label %cond_607_case_0.i, label %__barray_check_bounds.exit.9 - -__barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 - tail call void @___reset(i64 %qalloc.i.9) - %37 = load i64, ptr %1, align 4 - %38 = and i64 %37, 512 - %.not864 = icmp eq i64 %38, 0 - br i1 %.not864, label %panic.i, label %cond_exit_20.9 - -cond_exit_20.9: ; preds = %__barray_check_bounds.exit.9 - %39 = and i64 %37, -513 - store i64 %39, ptr %1, align 4 - %40 = getelementptr inbounds nuw i8, ptr %0, i64 72 - store i64 %qalloc.i.9, ptr %40, align 4 - %"116.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"116.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.0.insert", ptr %1, 1 - %"116.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"116.fca.1.insert", i64 0, 2 - br label %__barray_check_bounds.exit751 - -__barray_check_bounds.exit751: ; preds = %__barray_mask_return.exit756, %cond_exit_20.9 - %"47_0.0843" = phi i64 [ 0, %cond_exit_20.9 ], [ %41, %__barray_mask_return.exit756 ] - %41 = add nuw nsw i64 %"47_0.0843", 1 - %42 = load i64, ptr %1, align 4 - %43 = lshr i64 %42, %"47_0.0843" - %44 = trunc i64 %43 to i1 - br i1 %44, label %panic.i752, label %__barray_check_bounds.exit754 - -panic.i752: ; preds = %__barray_check_bounds.exit751 +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %17 = shl nuw nsw i64 1, %"100_2.0" + %18 = xor i64 %14, %17 + store i64 %18, ptr %9, align 4 + %19 = getelementptr inbounds nuw i64, ptr %8, i64 %"100_2.0" + store i64 %qalloc.i, ptr %19, align 4 + br label %cond_exit_104 + +cond_exit_104: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %12, %__barray_mask_return.exit ], [ %"100_2.0", %loop_body ] + %exitcond = icmp eq i64 %11, 11 + br i1 %exitcond, label %__barray_check_bounds.exit1794, label %loop_body + +__barray_check_bounds.exit1794: ; preds = %cond_exit_104, %__barray_mask_return.exit1799 + %20 = phi i64 [ %32, %__barray_mask_return.exit1799 ], [ 1, %cond_exit_104 ] + %"6_0.01885" = phi i64 [ %20, %__barray_mask_return.exit1799 ], [ 0, %cond_exit_104 ] + %21 = load i64, ptr %9, align 4 + %22 = lshr i64 %21, %"6_0.01885" + %23 = trunc i64 %22 to i1 + br i1 %23, label %panic.i1795, label %__barray_check_bounds.exit1797 + +panic.i1795: ; preds = %__barray_check_bounds.exit1794 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit754: ; preds = %__barray_check_bounds.exit751 - %45 = shl nuw nsw i64 1, %"47_0.0843" - %46 = xor i64 %42, %45 - store i64 %46, ptr %1, align 4 - %47 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0843" - %48 = load i64, ptr %47, align 4 - tail call void @___rp(i64 %48, double 0x400921FB54442D18, double 0.000000e+00) - %49 = load i64, ptr %1, align 4 - %50 = lshr i64 %49, %"47_0.0843" - %51 = trunc i64 %50 to i1 - br i1 %51, label %__barray_mask_return.exit756, label %panic.i755 - -panic.i755: ; preds = %__barray_check_bounds.exit754 +__barray_check_bounds.exit1797: ; preds = %__barray_check_bounds.exit1794 + %24 = shl nuw nsw i64 1, %"6_0.01885" + %25 = xor i64 %21, %24 + store i64 %25, ptr %9, align 4 + %26 = getelementptr inbounds nuw i64, ptr %8, i64 %"6_0.01885" + %27 = load i64, ptr %26, align 4 + tail call void @___rp(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) + %28 = load i64, ptr %9, align 4 + %29 = lshr i64 %28, %"6_0.01885" + %30 = trunc i64 %29 to i1 + br i1 %30, label %__barray_mask_return.exit1799, label %panic.i1798 + +panic.i1798: ; preds = %__barray_check_bounds.exit1797 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_mask_return.exit756: ; preds = %__barray_check_bounds.exit754 - %52 = xor i64 %49, %45 - store i64 %52, ptr %1, align 4 - store i64 %48, ptr %47, align 4 - %exitcond850.not = icmp eq i64 %41, 10 - br i1 %exitcond850.not, label %cond_exit_161, label %__barray_check_bounds.exit751 - -pow.i.preheader: ; preds = %cond_exit_89, %__barray_check_none_borrowed.exit819 - %"84_0.sroa.0.0845" = phi i64 [ 0, %__barray_check_none_borrowed.exit819 ], [ %53, %cond_exit_89 ] - %53 = add nuw nsw i64 %"84_0.sroa.0.0845", 1 - br label %pow.i - -pow.i: ; preds = %pow.i.preheader, %pow_body.i - %storemerge53.i = phi i64 [ %new_acc.i, %pow_body.i ], [ 2, %pow.i.preheader ] - %storemerge.i = phi i64 [ %new_exp.i, %pow_body.i ], [ %"84_0.sroa.0.0845", %pow.i.preheader ] - switch i64 %storemerge.i, label %pow_body.i [ - i64 1, label %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - i64 0, label %__barray_check_bounds.exit764 - ] - -pow_body.i: ; preds = %pow.i - %new_acc.i = shl i64 %storemerge53.i, 1 - %new_exp.i = add i64 %storemerge.i, -1 - br label %pow.i - -__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit: ; preds = %pow.i - %54 = sitofp i64 %storemerge53.i to double - br label %__barray_check_bounds.exit764 - -__barray_check_bounds.exit764: ; preds = %pow.i, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit - %storemerge55.i = phi double [ %54, %__hugr__.guppylang.std.num.int.__pow__.381.exit.loopexit ], [ 1.000000e+00, %pow.i ] - %55 = load i64, ptr %108, align 4 - %56 = lshr i64 %55, %"84_0.sroa.0.0845" - %57 = trunc i64 %56 to i1 - br i1 %57, label %cond_exit_89, label %panic.i765 +__barray_mask_return.exit1799: ; preds = %__barray_check_bounds.exit1797 + %31 = xor i64 %28, %24 + store i64 %31, ptr %9, align 4 + store i64 %27, ptr %26, align 4 + %32 = add nuw nsw i64 %20, 1 + %exitcond1895 = icmp eq i64 %32, 11 + br i1 %exitcond1895, label %loop_body321.preheader, label %__barray_check_bounds.exit1794 -panic.i765: ; preds = %__barray_check_bounds.exit764 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") +out_of_bounds.i1800: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") unreachable -cond_exit_89: ; preds = %__barray_check_bounds.exit764 - %58 = fdiv double 1.000000e+00, %storemerge55.i - %59 = shl nuw nsw i64 1, %"84_0.sroa.0.0845" - %60 = xor i64 %55, %59 - store i64 %60, ptr %108, align 4 - %61 = getelementptr inbounds nuw double, ptr %107, i64 %"84_0.sroa.0.0845" - store double %58, ptr %61, align 8 - %exitcond851.not = icmp eq i64 %53, 10 - br i1 %exitcond851.not, label %loop_out132, label %pow.i.preheader - -loop_out132: ; preds = %cond_exit_89 - %62 = load i64, ptr %108, align 4 - %63 = and i64 %62, 1023 - store i64 %63, ptr %108, align 4 - %64 = icmp eq i64 %63, 0 - br i1 %64, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -__barray_check_none_borrowed.exit: ; preds = %loop_out132 - %65 = call ptr @heap_alloc(i64 80) - %66 = call ptr @heap_alloc(i64 8) - store i64 0, ptr %66, align 1 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %65, ptr noundef nonnull align 1 dereferenceable(80) %107, i64 80, i1 false) - call void @heap_free(ptr nonnull %65) - %67 = load i64, ptr %108, align 4 - %68 = and i64 %67, 1023 - store i64 %68, ptr %108, align 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %__barray_check_none_borrowed.exit771, label %mask_block_err.i769 - -mask_block_err.i: ; preds = %loop_out132 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable +__barray_check_bounds.exit1801: ; preds = %.thread + %33 = load i64, ptr %3, align 4 + %34 = lshr i64 %33, %"476_2.01904" + %35 = trunc i64 %34 to i1 + br i1 %35, label %cond_exit_480, label %panic.i1802 -__barray_check_none_borrowed.exit771: ; preds = %__barray_check_none_borrowed.exit - %out_arr_alloca212 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr214 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 4 - %arr_ptr215 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 8 - %mask_ptr216 = getelementptr inbounds nuw i8, ptr %out_arr_alloca212, i64 16 - %70 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %70, i8 0, i64 10, i1 false) - store i32 10, ptr %out_arr_alloca212, align 8 - store i32 1, ptr %y_ptr214, align 4 - store ptr %107, ptr %arr_ptr215, align 8 - store ptr %70, ptr %mask_ptr216, align 8 - call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca212) - br label %__barray_check_bounds.exit779 - -mask_block_err.i769: ; preds = %__barray_check_none_borrowed.exit - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +panic.i1802: ; preds = %__barray_check_bounds.exit1801 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit779: ; preds = %cond_exit_131.1, %__barray_check_none_borrowed.exit771 - %"126_0.sroa.0.0847" = phi i64 [ 0, %__barray_check_none_borrowed.exit771 ], [ %87, %cond_exit_131.1 ] - %71 = lshr i64 %"126_0.sroa.0.0847", 6 - %72 = getelementptr inbounds nuw i64, ptr %106, i64 %71 - %73 = load i64, ptr %72, align 4 - %74 = and i64 %"126_0.sroa.0.0847", 62 - %75 = lshr i64 %73, %74 - %76 = trunc i64 %75 to i1 - br i1 %76, label %cond_exit_131, label %panic.i780 - -panic.i780: ; preds = %cond_exit_131, %__barray_check_bounds.exit779 - call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable +mask_block_ok.i: ; preds = %cond_exit_480 + %36 = load i64, ptr %9, align 4 + %37 = or i64 %36, -1024 + store i64 %37, ptr %9, align 4 + %38 = icmp eq i64 %37, -1 + br i1 %38, label %loop_body430.preheader.preheader, label %mask_block_err.i -cond_exit_131: ; preds = %__barray_check_bounds.exit779 - %77 = or disjoint i64 %"126_0.sroa.0.0847", 1 - %78 = shl nuw nsw i64 1, %74 - %79 = xor i64 %73, %78 - store i64 %79, ptr %72, align 4 - %80 = getelementptr inbounds nuw i64, ptr %105, i64 %"126_0.sroa.0.0847" - store i64 %"126_0.sroa.0.0847", ptr %80, align 4 - %81 = lshr i64 %"126_0.sroa.0.0847", 6 - %82 = getelementptr inbounds nuw i64, ptr %106, i64 %81 - %83 = load i64, ptr %82, align 4 - %84 = and i64 %77, 63 - %85 = lshr i64 %83, %84 - %86 = trunc i64 %85 to i1 - br i1 %86, label %cond_exit_131.1, label %panic.i780 - -cond_exit_131.1: ; preds = %cond_exit_131 - %87 = add nuw nsw i64 %"126_0.sroa.0.0847", 2 - %88 = shl nuw i64 1, %84 - %89 = xor i64 %83, %88 - store i64 %89, ptr %82, align 4 - %90 = getelementptr inbounds nuw i64, ptr %105, i64 %77 - store i64 %77, ptr %90, align 4 - %exitcond852.not.1 = icmp eq i64 %87, 100 - br i1 %exitcond852.not.1, label %loop_out220, label %__barray_check_bounds.exit779 - -loop_out220: ; preds = %cond_exit_131.1 - %91 = getelementptr inbounds nuw i8, ptr %106, i64 8 - %92 = load i64, ptr %91, align 4 - %93 = and i64 %92, 68719476735 - store i64 %93, ptr %91, align 4 - %94 = load i64, ptr %106, align 4 - %95 = icmp eq i64 %94, 0 - %96 = icmp eq i64 %93, 0 - %or.cond = select i1 %95, i1 %96, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit786, label %mask_block_err.i784 - -__barray_check_none_borrowed.exit786: ; preds = %loop_out220 - %97 = call ptr @heap_alloc(i64 800) - %98 = call ptr @heap_alloc(i64 16) - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %98, i8 0, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %97, ptr noundef nonnull align 1 dereferenceable(800) %105, i64 800, i1 false) - call void @heap_free(ptr nonnull %97) - %99 = load i64, ptr %91, align 4 - %100 = and i64 %99, 68719476735 - store i64 %100, ptr %91, align 4 - %101 = load i64, ptr %106, align 4 - %102 = icmp eq i64 %101, 0 - %103 = icmp eq i64 %100, 0 - %or.cond854 = select i1 %102, i1 %103, i1 false - br i1 %or.cond854, label %__barray_check_none_borrowed.exit791, label %mask_block_err.i789 - -mask_block_err.i784: ; preds = %loop_out220 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_none_borrowed.exit791: ; preds = %__barray_check_none_borrowed.exit786 - %out_arr_alloca296 = alloca <{ i32, i32, ptr, ptr }>, align 8 - %y_ptr298 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 4 - %arr_ptr299 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 8 - %mask_ptr300 = getelementptr inbounds nuw i8, ptr %out_arr_alloca296, i64 16 - %104 = alloca [100 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %104, i8 0, i64 100, i1 false) - store i32 100, ptr %out_arr_alloca296, align 8 - store i32 1, ptr %y_ptr298, align 4 - store ptr %105, ptr %arr_ptr299, align 8 - store ptr %104, ptr %mask_ptr300, align 8 - call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca296) - ret void +loop_body321.preheader: ; preds = %__barray_mask_return.exit1799, %cond_exit_480 + %"476_0.sroa.15.01905" = phi i64 [ %39, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %"476_2.01904" = phi i64 [ %47, %cond_exit_480 ], [ 0, %__barray_mask_return.exit1799 ] + %39 = add nuw nsw i64 %"476_0.sroa.15.01905", 1 + %40 = load i64, ptr %9, align 4 + %41 = lshr i64 %40, %"476_0.sroa.15.01905" + %42 = trunc i64 %41 to i1 + br i1 %42, label %panic.i1806, label %.thread -mask_block_err.i789: ; preds = %__barray_check_none_borrowed.exit786 - call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") - unreachable - -cond_exit_161: ; preds = %__barray_mask_return.exit756 - %105 = tail call ptr @heap_alloc(i64 800) - %106 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %106, i8 -1, i64 16, i1 false) - %107 = tail call ptr @heap_alloc(i64 80) - %108 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %108, align 1 - %109 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"116.fca.2.insert", 0 - %110 = tail call ptr @heap_alloc(i64 80) - %111 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %111, align 1 - br label %__barray_check_bounds.exit.i.i - -112: ; preds = %loop_body.i - %113 = lshr i64 %.fca.2.extract.i.i, 6 - %114 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %113 - %115 = load i64, ptr %114, align 4 - %116 = and i64 %.fca.2.extract.i.i, 63 - %117 = sub nuw nsw i64 64, %116 - %118 = lshr i64 -1, %117 - %119 = icmp eq i64 %116, 0 - %120 = select i1 %119, i64 0, i64 %118 - %121 = or i64 %115, %120 - store i64 %121, ptr %114, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 9 - %122 = lshr i64 %last_valid.i.i.i, 6 - %123 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %122 - %124 = load i64, ptr %123, align 4 - %125 = and i64 %last_valid.i.i.i, 63 - %126 = shl nsw i64 -2, %125 - %127 = icmp eq i64 %125, 63 - %128 = select i1 %127, i64 0, i64 %126 - %129 = or i64 %124, %128 - store i64 %129, ptr %123, align 4 - %reass.sub.i.i.i = sub nsw i64 %122, %113 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -130: ; preds = %mask_block_ok.i.i.i - %131 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %112, %130 - %.02.i.i.i = phi i64 [ %131, %130 ], [ 0, %112 ] - %gep.i.i.i = getelementptr i64, ptr %114, i64 %.02.i.i.i - %132 = load i64, ptr %gep.i.i.i, align 4 - %133 = icmp eq i64 %132, -1 - br i1 %133, label %130, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +panic.i1806: ; preds = %loop_body321.preheader + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_161 - %.fca.2.extract.i181.i = phi i64 [ 0, %cond_exit_161 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i180.i = phi ptr [ %1, %cond_exit_161 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i179.i = phi ptr [ %0, %cond_exit_161 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"313_0.sroa.15.0178.i" = phi i64 [ 0, %cond_exit_161 ], [ %134, %loop_body.i ] - %.pn159177.i = phi { { ptr, ptr, i64 }, i64 } [ %109, %cond_exit_161 ], [ %149, %loop_body.i ] - %134 = add nuw nsw i64 %"313_0.sroa.15.0178.i", 1 - %135 = add i64 %"313_0.sroa.15.0178.i", %.fca.2.extract.i181.i - %136 = lshr i64 %135, 6 - %137 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i180.i, i64 %136 - %138 = load i64, ptr %137, align 4 - %139 = and i64 %135, 63 - %140 = lshr i64 %138, %139 - %141 = trunc i64 %140 to i1 - br i1 %141, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i +.thread: ; preds = %loop_body321.preheader + %43 = shl nuw nsw i64 1, %"476_0.sroa.15.01905" + %44 = xor i64 %40, %43 + store i64 %44, ptr %9, align 4 + %45 = getelementptr inbounds nuw i64, ptr %8, i64 %"476_0.sroa.15.01905" + %46 = load i64, ptr %45, align 4 + %47 = add i64 %"476_2.01904", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %46) + tail call void @___qfree(i64 %46) + %48 = icmp ult i64 %"476_2.01904", 10 + br i1 %48, label %__barray_check_bounds.exit1801, label %out_of_bounds.i1800 + +cond_exit_480: ; preds = %__barray_check_bounds.exit1801 + %49 = shl nuw nsw i64 1, %"476_2.01904" + %50 = xor i64 %33, %49 + store i64 %50, ptr %3, align 4 + %51 = getelementptr inbounds nuw i64, ptr %2, i64 %"476_2.01904" + store i64 %lazy_measure, ptr %51, align 4 + %52 = icmp samesign ugt i64 %"476_0.sroa.15.01905", 8 + br i1 %52, label %mask_block_ok.i, label %loop_body321.preheader + +loop_body430.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr nonnull %8) + tail call void @heap_free(ptr nonnull %9) + br label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1809: ; preds = %cond_exit_546, %loop_body430.preheader.preheader + %"542_0.sroa.15.01887" = phi i64 [ %53, %cond_exit_546 ], [ 0, %loop_body430.preheader.preheader ] + %53 = add nuw nsw i64 %"542_0.sroa.15.01887", 1 + %54 = load i64, ptr %3, align 4 + %55 = lshr i64 %54, %"542_0.sroa.15.01887" + %56 = trunc i64 %55 to i1 + br i1 %56, label %panic.i1810, label %__barray_check_bounds.exit1813 + +panic.i1810: ; preds = %__barray_check_bounds.exit1809 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %142 = shl nuw i64 1, %139 - %143 = xor i64 %142, %138 - store i64 %143, ptr %137, align 4 - %144 = getelementptr inbounds i64, ptr %.fca.0.extract62.i179.i, i64 %135 - %145 = load i64, ptr %144, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %145) - tail call void @___qfree(i64 %145) - %146 = load i64, ptr %111, align 4 - %147 = lshr i64 %146, %"313_0.sroa.15.0178.i" - %148 = trunc i64 %147 to i1 - br i1 %148, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_check_bounds.exit1813: ; preds = %__barray_check_bounds.exit1809 + %57 = shl nuw nsw i64 1, %"542_0.sroa.15.01887" + %58 = xor i64 %54, %57 + store i64 %58, ptr %3, align 4 + %59 = getelementptr inbounds nuw i64, ptr %2, i64 %"542_0.sroa.15.01887" + %60 = load i64, ptr %59, align 4 + tail call void @___inc_future_refcount(i64 %60) + %61 = load i64, ptr %3, align 4 + %62 = lshr i64 %61, %"542_0.sroa.15.01887" + %63 = trunc i64 %62 to i1 + br i1 %63, label %__barray_check_bounds.exit1817, label %panic.i1814 + +panic.i1814: ; preds = %__barray_check_bounds.exit1813 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %149 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, i64 %134, 1 - %150 = shl nuw nsw i64 1, %"313_0.sroa.15.0178.i" - %151 = xor i64 %146, %150 - store i64 %151, ptr %111, align 4 - %152 = getelementptr inbounds nuw i64, ptr %110, i64 %"313_0.sroa.15.0178.i" - store i64 %lazy_measure.i, ptr %152, align 4 - %153 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159177.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %153, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %153, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %153, 2 - %exitcond.not.i792 = icmp eq i64 %134, 10 - br i1 %exitcond.not.i792, label %112, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$10.299.exit": ; preds = %130, %112 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"123.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %110, 0 - %"123.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.0.insert.i", ptr %111, 1 - %"123.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"123.fca.1.insert.i", i64 0, 2 - %154 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"123.fca.2.insert.i", 0 - %155 = tail call ptr @heap_alloc(i64 10) - %156 = tail call ptr @heap_alloc(i64 8) - store i64 -1, ptr %156, align 1 - br label %__barray_check_bounds.exit.i.i793 - -loop_body.preheader.i.i: ; preds = %loop_body.i796 - %"627_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 2 - %"627_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 1 - %"627_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %214, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i793: ; preds = %loop_body.i796, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" - %157 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %214, %loop_body.i796 ] - %"354_0.sroa.15.0168.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %158, %loop_body.i796 ] - %.pn159167.i = phi { { ptr, ptr, i64 }, i64 } [ %154, %"__hugr__.guppylang.std.quantum.measure_array$10.299.exit" ], [ %210, %loop_body.i796 ] - %158 = add nuw nsw i64 %"354_0.sroa.15.0168.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %157, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %157, 1 - %159 = add i64 %.fca.2.extract208.i.i, %"354_0.sroa.15.0168.i" - %160 = lshr i64 %159, 6 - %161 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %160 - %162 = load i64, ptr %161, align 4 - %163 = and i64 %159, 63 - %164 = lshr i64 %162, %163 - %165 = trunc i64 %164 to i1 - br i1 %165, label %panic.i.i.i809, label %__barray_check_bounds.exit221.i.i - -panic.i.i.i809: ; preds = %__barray_check_bounds.exit.i.i793 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i793 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %157, 0 - %166 = shl nuw i64 1, %163 - %167 = xor i64 %166, %162 - store i64 %167, ptr %161, align 4 - %168 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %159 - %169 = load i64, ptr %168, align 4 - tail call void @___inc_future_refcount(i64 %169) - %170 = load i64, ptr %161, align 4 - %171 = lshr i64 %170, %163 - %172 = trunc i64 %171 to i1 - br i1 %172, label %__barray_check_bounds.exit.i794, label %panic.i222.i.i - -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +__barray_check_bounds.exit1817: ; preds = %__barray_check_bounds.exit1813 + %64 = xor i64 %61, %57 + store i64 %64, ptr %3, align 4 + store i64 %60, ptr %59, align 4 + %read_bool = tail call i1 @___read_future_bool(i64 %60) + tail call void @___dec_future_refcount(i64 %60) + %65 = load i64, ptr %1, align 4 + %66 = lshr i64 %65, %"542_0.sroa.15.01887" + %67 = trunc i64 %66 to i1 + br i1 %67, label %cond_exit_546, label %panic.i1818 + +panic.i1818: ; preds = %__barray_check_bounds.exit1817 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_630_case_0.i.i: ; preds = %cond_exit_630.thread.i.i - %173 = lshr i64 %"627_1.sroa.10.0.i.i", 6 - %174 = getelementptr i64, ptr %"627_1.sroa.5.0.i.i", i64 %173 - %175 = load i64, ptr %174, align 4 - %176 = and i64 %"627_1.sroa.10.0.i.i", 63 - %177 = sub nuw nsw i64 64, %176 - %178 = lshr i64 -1, %177 - %179 = icmp eq i64 %176, 0 - %180 = select i1 %179, i64 0, i64 %178 - %181 = or i64 %175, %180 - store i64 %181, ptr %174, align 4 - %last_valid.i.i.i798 = add i64 %"627_1.sroa.10.0.i.i", 9 - %182 = lshr i64 %last_valid.i.i.i798, 6 - %183 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %182 - %184 = load i64, ptr %183, align 4 - %185 = and i64 %last_valid.i.i.i798, 63 - %186 = shl nsw i64 -2, %185 - %187 = icmp eq i64 %185, 63 - %188 = select i1 %187, i64 0, i64 %186 - %189 = or i64 %184, %188 - store i64 %189, ptr %183, align 4 - %reass.sub.i.i.i799 = sub nsw i64 %182, %173 - %.not.i.i.i800 = icmp eq i64 %reass.sub.i.i.i799, -1 - br i1 %.not.i.i.i800, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -190: ; preds = %mask_block_ok.i.i.i801 - %191 = add nuw i64 %.02.i.i.i802, 1 - %exitcond.not.i.i.i805 = icmp eq i64 %.02.i.i.i802, %reass.sub.i.i.i799 - br i1 %exitcond.not.i.i.i805, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit", label %mask_block_ok.i.i.i801 - -mask_block_ok.i.i.i801: ; preds = %cond_630_case_0.i.i, %190 - %.02.i.i.i802 = phi i64 [ %191, %190 ], [ 0, %cond_630_case_0.i.i ] - %gep.i.i.i803 = getelementptr i64, ptr %174, i64 %.02.i.i.i802 - %192 = load i64, ptr %gep.i.i.i803, align 4 - %193 = icmp eq i64 %192, -1 - br i1 %193, label %190, label %mask_block_err.i.i.i804 - -mask_block_err.i.i.i804: ; preds = %mask_block_ok.i.i.i801 +mask_block_err.i1823: ; preds = %cond_exit_729.9 tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_630.thread.i.i, %loop_body.preheader.i.i - %"627_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %194, %cond_exit_630.thread.i.i ] - %194 = add nuw nsw i64 %"627_0.0239.i.i", 1 - %195 = add i64 %"627_0.0239.i.i", %"627_1.sroa.10.0.i.i" - %196 = lshr i64 %195, 6 - %197 = getelementptr inbounds nuw i64, ptr %"627_1.sroa.5.0.i.i", i64 %196 - %198 = load i64, ptr %197, align 4 - %199 = and i64 %195, 63 - %200 = lshr i64 %198, %199 - %201 = trunc i64 %200 to i1 - br i1 %201, label %cond_exit_630.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %202 = shl nuw i64 1, %199 - %203 = xor i64 %202, %198 - store i64 %203, ptr %197, align 4 - %204 = getelementptr inbounds i64, ptr %"627_1.sroa.0.0.i.i", i64 %195 - %205 = load i64, ptr %204, align 4 - tail call void @___dec_future_refcount(i64 %205) - br label %cond_exit_630.thread.i.i - -cond_exit_630.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %194, 10 - br i1 %exitcond.i.i, label %cond_630_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i794: ; preds = %__barray_check_bounds.exit221.i.i - %206 = xor i64 %170, %166 - store i64 %206, ptr %161, align 4 - store i64 %169, ptr %168, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %169) - tail call void @___dec_future_refcount(i64 %169) - %207 = load i64, ptr %156, align 4 - %208 = lshr i64 %207, %"354_0.sroa.15.0168.i" - %209 = trunc i64 %208 to i1 - br i1 %209, label %loop_body.i796, label %panic.i.i795 - -panic.i.i795: ; preds = %__barray_check_bounds.exit.i794 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -loop_body.i796: ; preds = %__barray_check_bounds.exit.i794 - %210 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, i64 %158, 1 - %211 = shl nuw nsw i64 1, %"354_0.sroa.15.0168.i" - %212 = xor i64 %207, %211 - store i64 %212, ptr %156, align 4 - %213 = getelementptr inbounds nuw i1, ptr %155, i64 %"354_0.sroa.15.0168.i" - store i1 %read_bool.i, ptr %213, align 1 - %214 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn159167.i, 0 - %exitcond.not.i797 = icmp eq i64 %158, 10 - br i1 %exitcond.not.i797, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i793 - -"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit": ; preds = %190, %cond_630_case_0.i.i - tail call void @heap_free(ptr %"627_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"627_1.sroa.5.0.i.i") - %215 = load i64, ptr %156, align 4 - %216 = and i64 %215, 1023 - store i64 %216, ptr %156, align 4 - %217 = icmp eq i64 %216, 0 - br i1 %217, label %__barray_check_none_borrowed.exit814, label %mask_block_err.i812 - -__barray_check_none_borrowed.exit814: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" - %218 = tail call ptr @heap_alloc(i64 10) - %219 = tail call ptr @heap_alloc(i64 8) - store i64 0, ptr %219, align 1 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %218, ptr noundef nonnull align 1 dereferenceable(10) %155, i64 10, i1 false) - tail call void @heap_free(ptr nonnull %218) - %220 = load i64, ptr %156, align 4 - %221 = and i64 %220, 1023 - store i64 %221, ptr %156, align 4 - %222 = icmp eq i64 %221, 0 - br i1 %222, label %__barray_check_none_borrowed.exit819, label %mask_block_err.i817 - -mask_block_err.i812: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$10.340.exit" +__barray_mask_borrow.exit1831: ; preds = %__barray_check_bounds.exit1827.preheader + %68 = or disjoint i64 %121, 1 + store i64 %68, ptr %3, align 4 + %69 = load i64, ptr %2, align 4 + tail call void @___dec_future_refcount(i64 %69) + br label %cond_exit_729 + +cond_exit_729: ; preds = %__barray_mask_borrow.exit1831, %__barray_check_bounds.exit1827.preheader + %70 = load i64, ptr %3, align 4 + %71 = and i64 %70, 2 + %.not = icmp eq i64 %71, 0 + br i1 %.not, label %__barray_mask_borrow.exit1831.1, label %cond_exit_729.1 + +__barray_mask_borrow.exit1831.1: ; preds = %cond_exit_729 + %72 = or disjoint i64 %70, 2 + store i64 %72, ptr %3, align 4 + %73 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %74 = load i64, ptr %73, align 4 + tail call void @___dec_future_refcount(i64 %74) + br label %cond_exit_729.1 + +cond_exit_729.1: ; preds = %__barray_mask_borrow.exit1831.1, %cond_exit_729 + %75 = load i64, ptr %3, align 4 + %76 = and i64 %75, 4 + %.not1908 = icmp eq i64 %76, 0 + br i1 %.not1908, label %__barray_mask_borrow.exit1831.2, label %cond_exit_729.2 + +__barray_mask_borrow.exit1831.2: ; preds = %cond_exit_729.1 + %77 = or disjoint i64 %75, 4 + store i64 %77, ptr %3, align 4 + %78 = getelementptr inbounds nuw i8, ptr %2, i64 16 + %79 = load i64, ptr %78, align 4 + tail call void @___dec_future_refcount(i64 %79) + br label %cond_exit_729.2 + +cond_exit_729.2: ; preds = %__barray_mask_borrow.exit1831.2, %cond_exit_729.1 + %80 = load i64, ptr %3, align 4 + %81 = and i64 %80, 8 + %.not1909 = icmp eq i64 %81, 0 + br i1 %.not1909, label %__barray_mask_borrow.exit1831.3, label %cond_exit_729.3 + +__barray_mask_borrow.exit1831.3: ; preds = %cond_exit_729.2 + %82 = or disjoint i64 %80, 8 + store i64 %82, ptr %3, align 4 + %83 = getelementptr inbounds nuw i8, ptr %2, i64 24 + %84 = load i64, ptr %83, align 4 + tail call void @___dec_future_refcount(i64 %84) + br label %cond_exit_729.3 + +cond_exit_729.3: ; preds = %__barray_mask_borrow.exit1831.3, %cond_exit_729.2 + %85 = load i64, ptr %3, align 4 + %86 = and i64 %85, 16 + %.not1910 = icmp eq i64 %86, 0 + br i1 %.not1910, label %__barray_mask_borrow.exit1831.4, label %cond_exit_729.4 + +__barray_mask_borrow.exit1831.4: ; preds = %cond_exit_729.3 + %87 = or disjoint i64 %85, 16 + store i64 %87, ptr %3, align 4 + %88 = getelementptr inbounds nuw i8, ptr %2, i64 32 + %89 = load i64, ptr %88, align 4 + tail call void @___dec_future_refcount(i64 %89) + br label %cond_exit_729.4 + +cond_exit_729.4: ; preds = %__barray_mask_borrow.exit1831.4, %cond_exit_729.3 + %90 = load i64, ptr %3, align 4 + %91 = and i64 %90, 32 + %.not1911 = icmp eq i64 %91, 0 + br i1 %.not1911, label %__barray_mask_borrow.exit1831.5, label %cond_exit_729.5 + +__barray_mask_borrow.exit1831.5: ; preds = %cond_exit_729.4 + %92 = or disjoint i64 %90, 32 + store i64 %92, ptr %3, align 4 + %93 = getelementptr inbounds nuw i8, ptr %2, i64 40 + %94 = load i64, ptr %93, align 4 + tail call void @___dec_future_refcount(i64 %94) + br label %cond_exit_729.5 + +cond_exit_729.5: ; preds = %__barray_mask_borrow.exit1831.5, %cond_exit_729.4 + %95 = load i64, ptr %3, align 4 + %96 = and i64 %95, 64 + %.not1912 = icmp eq i64 %96, 0 + br i1 %.not1912, label %__barray_mask_borrow.exit1831.6, label %cond_exit_729.6 + +__barray_mask_borrow.exit1831.6: ; preds = %cond_exit_729.5 + %97 = or disjoint i64 %95, 64 + store i64 %97, ptr %3, align 4 + %98 = getelementptr inbounds nuw i8, ptr %2, i64 48 + %99 = load i64, ptr %98, align 4 + tail call void @___dec_future_refcount(i64 %99) + br label %cond_exit_729.6 + +cond_exit_729.6: ; preds = %__barray_mask_borrow.exit1831.6, %cond_exit_729.5 + %100 = load i64, ptr %3, align 4 + %101 = and i64 %100, 128 + %.not1913 = icmp eq i64 %101, 0 + br i1 %.not1913, label %__barray_mask_borrow.exit1831.7, label %cond_exit_729.7 + +__barray_mask_borrow.exit1831.7: ; preds = %cond_exit_729.6 + %102 = or disjoint i64 %100, 128 + store i64 %102, ptr %3, align 4 + %103 = getelementptr inbounds nuw i8, ptr %2, i64 56 + %104 = load i64, ptr %103, align 4 + tail call void @___dec_future_refcount(i64 %104) + br label %cond_exit_729.7 + +cond_exit_729.7: ; preds = %__barray_mask_borrow.exit1831.7, %cond_exit_729.6 + %105 = load i64, ptr %3, align 4 + %106 = and i64 %105, 256 + %.not1914 = icmp eq i64 %106, 0 + br i1 %.not1914, label %__barray_mask_borrow.exit1831.8, label %cond_exit_729.8 + +__barray_mask_borrow.exit1831.8: ; preds = %cond_exit_729.7 + %107 = or disjoint i64 %105, 256 + store i64 %107, ptr %3, align 4 + %108 = getelementptr inbounds nuw i8, ptr %2, i64 64 + %109 = load i64, ptr %108, align 4 + tail call void @___dec_future_refcount(i64 %109) + br label %cond_exit_729.8 + +cond_exit_729.8: ; preds = %__barray_mask_borrow.exit1831.8, %cond_exit_729.7 + %110 = load i64, ptr %3, align 4 + %111 = and i64 %110, 512 + %.not1915 = icmp eq i64 %111, 0 + br i1 %.not1915, label %__barray_mask_borrow.exit1831.9, label %cond_exit_729.9 + +__barray_mask_borrow.exit1831.9: ; preds = %cond_exit_729.8 + %112 = or disjoint i64 %110, 512 + store i64 %112, ptr %3, align 4 + %113 = getelementptr inbounds nuw i8, ptr %2, i64 72 + %114 = load i64, ptr %113, align 4 + tail call void @___dec_future_refcount(i64 %114) + br label %cond_exit_729.9 + +cond_exit_729.9: ; preds = %__barray_mask_borrow.exit1831.9, %cond_exit_729.8 + %115 = load i64, ptr %3, align 4 + %116 = or i64 %115, -1024 + store i64 %116, ptr %3, align 4 + %117 = icmp eq i64 %116, -1 + br i1 %117, label %loop_out429, label %mask_block_err.i1823 + +cond_exit_546: ; preds = %__barray_check_bounds.exit1817 + %118 = xor i64 %65, %57 + store i64 %118, ptr %1, align 4 + %119 = getelementptr inbounds nuw i1, ptr %0, i64 %"542_0.sroa.15.01887" + store i1 %read_bool, ptr %119, align 1 + %120 = icmp eq i64 %"542_0.sroa.15.01887", 9 + br i1 %120, label %__barray_check_bounds.exit1827.preheader, label %__barray_check_bounds.exit1809 + +__barray_check_bounds.exit1827.preheader: ; preds = %cond_exit_546 + %121 = load i64, ptr %3, align 4 + %122 = trunc i64 %121 to i1 + br i1 %122, label %cond_exit_729, label %__barray_mask_borrow.exit1831 + +loop_out429: ; preds = %cond_exit_729.9 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %123 = load i64, ptr %1, align 4 + %124 = and i64 %123, 1023 + store i64 %124, ptr %1, align 4 + %125 = icmp eq i64 %124, 0 + br i1 %125, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1834 + +__barray_check_none_borrowed.exit: ; preds = %loop_out429 + %126 = tail call ptr @heap_alloc(i64 10) + %127 = tail call ptr @heap_alloc(i64 8) + store i64 0, ptr %127, align 1 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %126, ptr noundef nonnull align 1 dereferenceable(10) %0, i64 10, i1 false) + tail call void @heap_free(ptr nonnull %126) + %128 = load i64, ptr %1, align 4 + %129 = and i64 %128, 1023 + store i64 %129, ptr %1, align 4 + %130 = icmp eq i64 %129, 0 + br i1 %130, label %__barray_check_none_borrowed.exit1840, label %mask_block_err.i1838 + +mask_block_err.i1834: ; preds = %loop_out429 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit819: ; preds = %__barray_check_none_borrowed.exit814 +__barray_check_none_borrowed.exit1840: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %223 = alloca [10 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %223, i8 0, i64 10, i1 false) + %131 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %131, i8 0, i64 10, i1 false) store i32 10, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %155, ptr %arr_ptr, align 8 - store ptr %223, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %131, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) - br label %pow.i.preheader + br label %cond_221_case_1 -mask_block_err.i817: ; preds = %__barray_check_none_borrowed.exit814 +mask_block_err.i1838: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable + +cond_221_case_1: ; preds = %__barray_check_none_borrowed.exit1840, %cond_exit_221 + %"217_2.01889" = phi i64 [ 0, %__barray_check_none_borrowed.exit1840 ], [ %132, %cond_exit_221 ] + %132 = add nuw nsw i64 %"217_2.01889", 1 + br label %pow + +cond_exit_221: ; preds = %__barray_check_bounds.exit1852 + %133 = fdiv double 1.000000e+00, %storemerge1893 + %134 = shl nuw nsw i64 1, %"217_2.01889" + %135 = xor i64 %147, %134 + store i64 %135, ptr %7, align 4 + %136 = getelementptr inbounds nuw double, ptr %6, i64 %"217_2.01889" + store double %133, ptr %136, align 8 + %exitcond1896 = icmp eq i64 %132, 10 + br i1 %exitcond1896, label %loop_out649, label %cond_221_case_1 + +loop_out649: ; preds = %cond_exit_221 + %137 = load i64, ptr %7, align 4 + %138 = and i64 %137, 1023 + store i64 %138, ptr %7, align 4 + %139 = icmp eq i64 %138, 0 + br i1 %139, label %__barray_check_none_borrowed.exit1845, label %mask_block_err.i1843 + +__barray_check_none_borrowed.exit1845: ; preds = %loop_out649 + %140 = call ptr @heap_alloc(i64 80) + %141 = call ptr @heap_alloc(i64 8) + store i64 0, ptr %141, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(80) %140, ptr noundef nonnull align 1 dereferenceable(80) %6, i64 80, i1 false) + call void @heap_free(ptr nonnull %140) + %142 = load i64, ptr %7, align 4 + %143 = and i64 %142, 1023 + store i64 %143, ptr %7, align 4 + %144 = icmp eq i64 %143, 0 + br i1 %144, label %__barray_check_none_borrowed.exit1850, label %mask_block_err.i1848 + +mask_block_err.i1843: ; preds = %loop_out649 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1850: ; preds = %__barray_check_none_borrowed.exit1845 + %out_arr_alloca852 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr854 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 4 + %arr_ptr855 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 8 + %mask_ptr856 = getelementptr inbounds nuw i8, ptr %out_arr_alloca852, i64 16 + %145 = alloca [10 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %145, i8 0, i64 10, i1 false) + store i32 10, ptr %out_arr_alloca852, align 8 + store i32 1, ptr %y_ptr854, align 4 + store ptr %6, ptr %arr_ptr855, align 8 + store ptr %145, ptr %mask_ptr856, align 8 + call void @print_float_arr(ptr nonnull @res_floats.8646C2EF.0, i64 20, ptr nonnull %out_arr_alloca852) + br label %__barray_check_bounds.exit1856 + +mask_block_err.i1848: ; preds = %__barray_check_none_borrowed.exit1845 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +pow: ; preds = %pow_body, %cond_221_case_1 + %storemerge1684 = phi i64 [ 2, %cond_221_case_1 ], [ %new_acc, %pow_body ] + %storemerge = phi i64 [ %"217_2.01889", %cond_221_case_1 ], [ %new_exp, %pow_body ] + switch i64 %storemerge, label %pow_body [ + i64 1, label %done.loopexit + i64 0, label %__barray_check_bounds.exit1852 + ] + +pow_body: ; preds = %pow + %new_acc = shl i64 %storemerge1684, 1 + %new_exp = add i64 %storemerge, -1 + br label %pow + +done.loopexit: ; preds = %pow + %146 = sitofp i64 %storemerge1684 to double + br label %__barray_check_bounds.exit1852 + +__barray_check_bounds.exit1852: ; preds = %pow, %done.loopexit + %storemerge1893 = phi double [ %146, %done.loopexit ], [ 1.000000e+00, %pow ] + %147 = load i64, ptr %7, align 4 + %148 = lshr i64 %147, %"217_2.01889" + %149 = trunc i64 %148 to i1 + br i1 %149, label %cond_exit_221, label %panic.i1853 + +panic.i1853: ; preds = %__barray_check_bounds.exit1852 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +__barray_check_bounds.exit1856: ; preds = %cond_exit_366.1, %__barray_check_none_borrowed.exit1850 + %"362_2.01892" = phi i64 [ 0, %__barray_check_none_borrowed.exit1850 ], [ %166, %cond_exit_366.1 ] + %150 = lshr i64 %"362_2.01892", 6 + %151 = getelementptr inbounds nuw i64, ptr %5, i64 %150 + %152 = load i64, ptr %151, align 4 + %153 = and i64 %"362_2.01892", 62 + %154 = lshr i64 %152, %153 + %155 = trunc i64 %154 to i1 + br i1 %155, label %cond_exit_366, label %panic.i1857 + +panic.i1857: ; preds = %cond_exit_366, %__barray_check_bounds.exit1856 + call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") + unreachable + +cond_exit_366: ; preds = %__barray_check_bounds.exit1856 + %156 = or disjoint i64 %"362_2.01892", 1 + %157 = shl nuw nsw i64 1, %153 + %158 = xor i64 %152, %157 + store i64 %158, ptr %151, align 4 + %159 = getelementptr inbounds nuw i64, ptr %4, i64 %"362_2.01892" + store i64 %"362_2.01892", ptr %159, align 4 + %160 = lshr i64 %"362_2.01892", 6 + %161 = getelementptr inbounds nuw i64, ptr %5, i64 %160 + %162 = load i64, ptr %161, align 4 + %163 = and i64 %156, 63 + %164 = lshr i64 %162, %163 + %165 = trunc i64 %164 to i1 + br i1 %165, label %cond_exit_366.1, label %panic.i1857 + +cond_exit_366.1: ; preds = %cond_exit_366 + %166 = add nuw nsw i64 %"362_2.01892", 2 + %167 = shl nuw i64 1, %163 + %168 = xor i64 %162, %167 + store i64 %168, ptr %161, align 4 + %169 = getelementptr inbounds nuw i64, ptr %4, i64 %156 + store i64 %156, ptr %169, align 4 + %exitcond1897.1 = icmp eq i64 %166, 100 + br i1 %exitcond1897.1, label %loop_out860, label %__barray_check_bounds.exit1856 + +loop_out860: ; preds = %cond_exit_366.1 + %170 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %171 = load i64, ptr %170, align 4 + %172 = and i64 %171, 68719476735 + store i64 %172, ptr %170, align 4 + %173 = load i64, ptr %5, align 4 + %174 = icmp eq i64 %173, 0 + %175 = icmp eq i64 %172, 0 + %or.cond = select i1 %174, i1 %175, i1 false + br i1 %or.cond, label %__barray_check_none_borrowed.exit1863, label %mask_block_err.i1861 + +__barray_check_none_borrowed.exit1863: ; preds = %loop_out860 + %176 = call ptr @heap_alloc(i64 800) + %177 = call ptr @heap_alloc(i64 16) + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %177, i8 0, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(800) %176, ptr noundef nonnull align 1 dereferenceable(800) %4, i64 800, i1 false) + call void @heap_free(ptr nonnull %176) + %178 = load i64, ptr %170, align 4 + %179 = and i64 %178, 68719476735 + store i64 %179, ptr %170, align 4 + %180 = load i64, ptr %5, align 4 + %181 = icmp eq i64 %180, 0 + %182 = icmp eq i64 %179, 0 + %or.cond1902 = select i1 %181, i1 %182, i1 false + br i1 %or.cond1902, label %__barray_check_none_borrowed.exit1868, label %mask_block_err.i1866 + +mask_block_err.i1861: ; preds = %loop_out860 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable + +__barray_check_none_borrowed.exit1868: ; preds = %__barray_check_none_borrowed.exit1863 + %out_arr_alloca1023 = alloca <{ i32, i32, ptr, ptr }>, align 8 + %y_ptr1025 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 4 + %arr_ptr1026 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 8 + %mask_ptr1027 = getelementptr inbounds nuw i8, ptr %out_arr_alloca1023, i64 16 + %183 = alloca [100 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %183, i8 0, i64 100, i1 false) + store i32 100, ptr %out_arr_alloca1023, align 8 + store i32 1, ptr %y_ptr1025, align 4 + store ptr %4, ptr %arr_ptr1026, align 8 + store ptr %183, ptr %mask_ptr1027, align 8 + call void @print_int_arr(ptr nonnull @res_ints.B3BC9D53.0, i64 16, ptr nonnull %out_arr_alloca1023) + ret void + +mask_block_err.i1866: ; preds = %__barray_check_none_borrowed.exit1863 + call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") + unreachable } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -698,26 +604,26 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr - -declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_float_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @print_int_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-apple-darwin.ll index 0f7bd2f6..7844fc7d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-unknown-linux-gnu.ll index 60d2434e..d8e65013 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-aarch64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-apple-darwin.ll index 5ce72eef..a1d32e84 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-unknown-linux-gnu.ll index 3cf0bfbf..503e50d9 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-windows-gnu.ll index c0db9f2e..0040ad68 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-helios-x86_64-windows-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_helios_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_helios_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-apple-darwin.ll index b22ed02d..524c83da 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-unknown-linux-gnu.ll index 27e27e26..d9a1c67d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-aarch64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-apple-darwin.ll index feaf17ac..ca57cada 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-apple-darwin.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-unknown-linux-gnu.ll index 51120740..0d7e519d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-unknown-linux-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-windows-gnu.ll index c938d004..0dc9ebe7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_corrupted_plugin_unparsed/corrupted_plugin-sol-x86_64-windows-gnu.ll @@ -10,13 +10,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_21_case_0.i, label %__hugr__.__tk2_sol_qalloc.17.exit + br i1 %not_max.not.not.i, label %cond_13_case_0.i, label %__hugr__.__tk2_sol_qalloc.9.exit -cond_21_case_0.i: ; preds = %alloca_block +cond_13_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.17.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.9.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-apple-darwin.ll index 49f8e793..0bfeb1ef 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-unknown-linux-gnu.ll index 97ee0888..883bf6a3 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-apple-darwin.ll index be7a3b78..11673473 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-unknown-linux-gnu.ll index 2a7dda42..b4838677 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-windows-gnu.ll index 2f36b2ff..68e712ff 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-helios-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_helios_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-apple-darwin.ll index 1aecd1c4..8be3d288 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-unknown-linux-gnu.ll index 3e9ecef0..54bfdda0 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-apple-darwin.ll index 4a62ede3..c40f1810 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-unknown-linux-gnu.ll index 68ee5efd..77600b40 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-windows-gnu.ll index 7a954387..c4322251 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_exit_unparsed/exit_unparsed-sol-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit + br i1 %not_max.not.not.i, label %cond_38_case_0.i, label %__hugr__.__tk2_sol_qalloc.34.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_38_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.34.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.34.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll index 10a976db..12fdf49b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll index c2d46c7b..783cf528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll index 2569ee8b..c6291e99 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll index ccfbb7b8..104ba9e6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll index c4d01074..a6abcf96 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll index 2836b272..2829f836 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll index 56e7eac7..e378ea13 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll index 7dea4e36..f8d9de48 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll index 9b48c0f8..adbd8598 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll index 2e5949dc..c99060f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_multishot_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll index 10a976db..12fdf49b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll index c2d46c7b..783cf528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll index 2569ee8b..c6291e99 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll index ccfbb7b8..104ba9e6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll index c4d01074..a6abcf96 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll index 2836b272..2829f836 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll index 56e7eac7..e378ea13 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll index 7dea4e36..f8d9de48 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll index 9b48c0f8..adbd8598 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll index 2e5949dc..c99060f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll index 10a976db..12fdf49b 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll index c2d46c7b..783cf528 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-aarch64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll index 2569ee8b..c6291e99 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll index ccfbb7b8..104ba9e6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll index c4d01074..a6abcf96 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-helios-x86_64-windows-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_helios_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_helios_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_helios_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.50.exit: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_helios_qalloc.23.exit35: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_helios_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_helios_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.64.exit: ; preds = %__hugr__.__tk2_helios_qalloc.50.exit +__hugr__.__tk2_helios_qalloc.23.exit39: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rxy(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_helios_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_helios_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_helios_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_helios_qalloc.23.exit43: ; preds = %__hugr__.__tk2_helios_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rxy(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_helios_qalloc.78.exit: ; preds = %__hugr__.__tk2_heli %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll index 2836b272..2829f836 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll index 56e7eac7..e378ea13 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-aarch64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll index 7dea4e36..f8d9de48 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-apple-darwin.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll index 9b48c0f8..adbd8598 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-unknown-linux-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll index 2e5949dc..c99060f8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_flip_some_with_metrics_unparsed/unparsed_flip_n4-sol-x86_64-windows-gnu.ll @@ -13,54 +13,54 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit + br i1 %not_max.not.not.i, label %cond_27_case_0.i, label %__hugr__.__tk2_sol_qalloc.23.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_27_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.23.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i34 = tail call i64 @___qalloc() - %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1 - br i1 %not_max.not.not.i35, label %cond_54_case_0.i, label %__hugr__.__tk2_sol_qalloc.50.exit + %qalloc.i32 = tail call i64 @___qalloc() + %not_max.not.not.i33 = icmp eq i64 %qalloc.i32, -1 + br i1 %not_max.not.not.i33, label %cond_27_case_0.i34, label %__hugr__.__tk2_sol_qalloc.23.exit35 -cond_54_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_27_case_0.i34: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.50.exit: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit - tail call void @___reset(i64 %qalloc.i34) +__hugr__.__tk2_sol_qalloc.23.exit35: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit + tail call void @___reset(i64 %qalloc.i32) %qalloc.i36 = tail call i64 @___qalloc() %not_max.not.not.i37 = icmp eq i64 %qalloc.i36, -1 - br i1 %not_max.not.not.i37, label %cond_68_case_0.i, label %__hugr__.__tk2_sol_qalloc.64.exit + br i1 %not_max.not.not.i37, label %cond_27_case_0.i38, label %__hugr__.__tk2_sol_qalloc.23.exit39 -cond_68_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +cond_27_case_0.i38: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.64.exit: ; preds = %__hugr__.__tk2_sol_qalloc.50.exit +__hugr__.__tk2_sol_qalloc.23.exit39: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit35 tail call void @___reset(i64 %qalloc.i36) tail call void @___rp(i64 %qalloc.i36, double 0x400921FB54442D18, double 0.000000e+00) - %qalloc.i38 = tail call i64 @___qalloc() - %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1 - br i1 %not_max.not.not.i39, label %cond_82_case_0.i, label %__hugr__.__tk2_sol_qalloc.78.exit + %qalloc.i40 = tail call i64 @___qalloc() + %not_max.not.not.i41 = icmp eq i64 %qalloc.i40, -1 + br i1 %not_max.not.not.i41, label %cond_27_case_0.i42, label %__hugr__.__tk2_sol_qalloc.23.exit43 -cond_82_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit +cond_27_case_0.i42: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_qalloc.64.exit - tail call void @___reset(i64 %qalloc.i38) +__hugr__.__tk2_sol_qalloc.23.exit43: ; preds = %__hugr__.__tk2_sol_qalloc.23.exit39 + tail call void @___reset(i64 %qalloc.i40) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) - tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) + tail call void @___rp(i64 %qalloc.i40, double 0x400921FB54442D18, double 0.000000e+00) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_c0.7C14CD6E.0, i64 12, i1 %read_bool) - %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i34) - tail call void @___qfree(i64 %qalloc.i34) + %lazy_measure9 = tail call i64 @___lazy_measure(i64 %qalloc.i32) + tail call void @___qfree(i64 %qalloc.i32) %read_bool11 = tail call i1 @___read_future_bool(i64 %lazy_measure9) tail call void @___dec_future_refcount(i64 %lazy_measure9) tail call void @print_bool(ptr nonnull @res_c1.1F7A6571.0, i64 12, i1 %read_bool11) @@ -69,8 +69,8 @@ __hugr__.__tk2_sol_qalloc.78.exit: ; preds = %__hugr__.__tk2_sol_ %read_bool19 = tail call i1 @___read_future_bool(i64 %lazy_measure17) tail call void @___dec_future_refcount(i64 %lazy_measure17) tail call void @print_bool(ptr nonnull @res_c2.60825383.0, i64 12, i1 %read_bool19) - %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i38) - tail call void @___qfree(i64 %qalloc.i38) + %lazy_measure25 = tail call i64 @___lazy_measure(i64 %qalloc.i40) + tail call void @___qfree(i64 %qalloc.i40) %read_bool27 = tail call i1 @___read_future_bool(i64 %lazy_measure25) tail call void @___dec_future_refcount(i64 %lazy_measure25) tail call void @print_bool(ptr nonnull @res_c3.B223E16D.0, i64 12, i1 %read_bool27) diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-apple-darwin.ll index a251a3e8..a47b5a2e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "aarch64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-unknown-linux-gnu.ll index 71584c05..42cfcc76 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-aarch64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-apple-darwin.ll index 8203c197..dc0cedda 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "x86_64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-unknown-linux-gnu.ll index cf72ec6c..71be0d68 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-windows-gnu.ll index 1ab4001b..d010367f 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-helios-x86_64-windows-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-windows-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_helios_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rxy(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_helios_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_helios_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_helios_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rxy(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_helios_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_helios_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-apple-darwin.ll index 46d37de4..eeca75f5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "aarch64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-unknown-linux-gnu.ll index 8e7e6a04..3364ed5e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-aarch64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-apple-darwin.ll index 1f04880f..bd9e68a5 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-apple-darwin.ll @@ -9,27 +9,27 @@ target triple = "x86_64-apple-darwin" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-unknown-linux-gnu.ll index 8fb1fe44..a32c01cc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-unknown-linux-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-windows-gnu.ll index 05f9df4b..7c30514a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_infinite_loop_unparsed/infinite_loop-sol-x86_64-windows-gnu.ll @@ -9,27 +9,27 @@ target triple = "x86_64-windows-gnu" ; Function Attrs: noreturn define void @__hugr__.__main__.main.1() local_unnamed_addr #0 { alloca_block: - %qalloc.i12 = tail call i64 @___qalloc() - %not_max.not.not.i13 = icmp eq i64 %qalloc.i12, -1 - br i1 %not_max.not.not.i13, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + %qalloc.i8 = tail call i64 @___qalloc() + %not_max.not.not.i9 = icmp eq i64 %qalloc.i8, -1 + br i1 %not_max.not.not.i9, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit -cond_30_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.26.exit, %alloca_block +cond_20_case_0.i: ; preds = %__hugr__.__tk2_sol_qalloc.16.exit, %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.26.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.26.exit - %qalloc.i14 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.26.exit ], [ %qalloc.i12, %alloca_block ] - tail call void @___reset(i64 %qalloc.i14) - tail call void @___rp(i64 %qalloc.i14, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) - tail call void @___rz(i64 %qalloc.i14, double 0x400921FB54442D18) - %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i14) - tail call void @___qfree(i64 %qalloc.i14) +__hugr__.__tk2_sol_qalloc.16.exit: ; preds = %alloca_block, %__hugr__.__tk2_sol_qalloc.16.exit + %qalloc.i10 = phi i64 [ %qalloc.i, %__hugr__.__tk2_sol_qalloc.16.exit ], [ %qalloc.i8, %alloca_block ] + tail call void @___reset(i64 %qalloc.i10) + tail call void @___rp(i64 %qalloc.i10, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) + tail call void @___rz(i64 %qalloc.i10, double 0x400921FB54442D18) + %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i10) + tail call void @___qfree(i64 %qalloc.i10) %read_bool = tail call i1 @___read_future_bool(i64 %lazy_measure) tail call void @___dec_future_refcount(i64 %lazy_measure) tail call void @print_bool(ptr nonnull @res_r.F13F95F2.0, i64 11, i1 %read_bool) %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_30_case_0.i, label %__hugr__.__tk2_sol_qalloc.26.exit + br i1 %not_max.not.not.i, label %cond_20_case_0.i, label %__hugr__.__tk2_sol_qalloc.16.exit } declare i64 @___lazy_measure(i64) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-apple-darwin.ll index 5016f16a..ac0cfdd6 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-apple-darwin.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_helios_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_helios_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rxy(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rxy(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-unknown-linux-gnu.ll index 60cbd469..635b7411 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-aarch64-unknown-linux-gnu.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_helios_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_helios_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rxy(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rxy(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-apple-darwin.ll index 375983d9..b706598d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-apple-darwin.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_helios_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_helios_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rxy(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rxy(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-unknown-linux-gnu.ll index b9bde37a..e8b85b0a 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-unknown-linux-gnu.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_helios_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_helios_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rxy(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rxy(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-windows-gnu.ll index 15597542..5c566068 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-helios-x86_64-windows-gnu.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_helios_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_helios_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_helios_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rxy(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rxy(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rxy(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-apple-darwin.ll index 753873bf..d3eb9a5d 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-apple-darwin.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_sol_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_sol_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rp(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rp(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-unknown-linux-gnu.ll index f8bb9bb8..41a060fc 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-aarch64-unknown-linux-gnu.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_sol_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_sol_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rp(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rp(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-apple-darwin.ll index 2676a8b8..a95e1fa8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-apple-darwin.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_sol_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_sol_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rp(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rp(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-unknown-linux-gnu.ll index 908c3884..e975486c 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-unknown-linux-gnu.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_sol_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_sol_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rp(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rp(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-windows-gnu.ll index cccbd78d..bd8059e2 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_memory_allocation_unparsed/memory_allocation-sol-x86_64-windows-gnu.ll @@ -3,407 +3,349 @@ source_filename = "hugr" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-windows-gnu" +@"e_Index out .DD115165.0" = private constant [29 x i8] c"\1CEXIT:INT:Index out of bounds" @"e_Array alre.5A300C2A.0" = private constant [57 x i8] c"8EXIT:INT:Array already contains an element at this index" -@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" -@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_Array elem.E746B1A3.0" = private constant [43 x i8] c"*EXIT:INT:Array element is already borrowed" @"e_Array cont.EFA5AC45.0" = private constant [70 x i8] c"EEXIT:INT:Array contains non-borrowed elements and cannot be discarded" +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_bools.B1D99BB9.0 = private constant [19 x i8] c"\12USER:BOOLARR:bools" @"e_No more qu.3B2EEBF0.0" = private constant [47 x i8] c".EXIT:INT:No more qubits available to allocate." define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: - %0 = tail call ptr @heap_alloc(i64 560) + %0 = tail call ptr @heap_alloc(i64 70) %1 = tail call ptr @heap_alloc(i64 16) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %1, i8 -1, i64 16, i1 false) - br label %cond_20_case_1 - -2: ; preds = %finish, %__barray_mask_return.exit552 - %exitcond568.not = icmp eq i64 %139, 70 - br i1 %exitcond568.not, label %cond_exit_82, label %finish - -cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0566" = phi i64 [ 0, %alloca_block ], [ %3, %cond_exit_20 ] - %3 = add nuw nsw i64 %"15_0.sroa.0.0566", 1 + %2 = tail call ptr @heap_alloc(i64 560) + %3 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %3, i8 -1, i64 16, i1 false) + %4 = tail call ptr @heap_alloc(i64 560) + %5 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %5, i8 -1, i64 16, i1 false) + br label %loop_body + +loop_body: ; preds = %cond_exit_132, %alloca_block + %"128_2.0" = phi i64 [ 0, %alloca_block ], [ %"2109.0", %cond_exit_132 ] + %"128_0.sroa.0.0" = phi i64 [ 0, %alloca_block ], [ %7, %cond_exit_132 ] + %6 = icmp samesign ugt i64 %"128_0.sroa.0.0", 69 + %7 = add nuw nsw i64 %"128_0.sroa.0.0", 1 + br i1 %6, label %cond_exit_132, label %cond_132_case_1 + +cond_132_case_1: ; preds = %loop_body + %8 = add i64 %"128_2.0", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_502_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_436_case_0.i, label %__hugr__.__tk2_sol_qalloc.432.exit -cond_502_case_0.i: ; preds = %cond_20_case_1 +cond_436_case_0.i: ; preds = %cond_132_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__barray_check_bounds.exit: ; preds = %cond_20_case_1 +__hugr__.__tk2_sol_qalloc.432.exit: ; preds = %cond_132_case_1 tail call void @___reset(i64 %qalloc.i) - %4 = lshr i64 %"15_0.sroa.0.0566", 6 - %5 = getelementptr inbounds nuw i64, ptr %1, i64 %4 - %6 = load i64, ptr %5, align 4 - %7 = and i64 %"15_0.sroa.0.0566", 63 - %8 = lshr i64 %6, %7 - %9 = trunc i64 %8 to i1 - br i1 %9, label %cond_exit_20, label %panic.i + %9 = icmp ult i64 %"128_2.0", 70 + br i1 %9, label %__barray_check_bounds.exit, label %out_of_bounds.i + +out_of_bounds.i: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit: ; preds = %__hugr__.__tk2_sol_qalloc.432.exit + %10 = lshr i64 %"128_2.0", 6 + %11 = getelementptr inbounds nuw i64, ptr %5, i64 %10 + %12 = load i64, ptr %11, align 4 + %13 = and i64 %"128_2.0", 63 + %14 = lshr i64 %12, %13 + %15 = trunc i64 %14 to i1 + br i1 %15, label %__barray_mask_return.exit, label %panic.i panic.i: ; preds = %__barray_check_bounds.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__barray_check_bounds.exit - %10 = shl nuw i64 1, %7 - %11 = xor i64 %6, %10 - store i64 %11, ptr %5, align 4 - %12 = getelementptr inbounds nuw i64, ptr %0, i64 %"15_0.sroa.0.0566" - store i64 %qalloc.i, ptr %12, align 4 - %exitcond.not = icmp eq i64 %3, 70 - br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 - -loop_out: ; preds = %cond_exit_20 - %"117.fca.0.insert" = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0 - %"117.fca.1.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.0.insert", ptr %1, 1 - %"117.fca.2.insert" = insertvalue { ptr, ptr, i64 } %"117.fca.1.insert", i64 0, 2 - br label %finish - -cond_exit_82: ; preds = %2 - %13 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"117.fca.2.insert", 0 - %14 = tail call ptr @heap_alloc(i64 560) - %15 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %15, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i - -16: ; preds = %loop_body.i - %17 = lshr i64 %.fca.2.extract.i.i, 6 - %18 = getelementptr i64, ptr %.fca.1.extract63.i.i, i64 %17 - %19 = load i64, ptr %18, align 4 - %20 = and i64 %.fca.2.extract.i.i, 63 - %21 = sub nuw nsw i64 64, %20 - %22 = lshr i64 -1, %21 - %23 = icmp eq i64 %20, 0 - %24 = select i1 %23, i64 0, i64 %22 - %25 = or i64 %19, %24 - store i64 %25, ptr %18, align 4 - %last_valid.i.i.i = add i64 %.fca.2.extract.i.i, 69 - %26 = lshr i64 %last_valid.i.i.i, 6 - %27 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i.i, i64 %26 - %28 = load i64, ptr %27, align 4 - %29 = and i64 %last_valid.i.i.i, 63 - %30 = shl nsw i64 -2, %29 - %31 = icmp eq i64 %29, 63 - %32 = select i1 %31, i64 0, i64 %30 - %33 = or i64 %28, %32 - store i64 %33, ptr %27, align 4 - %reass.sub.i.i.i = sub nsw i64 %26, %17 - %.not.i.i.i = icmp eq i64 %reass.sub.i.i.i, -1 - br i1 %.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -34: ; preds = %mask_block_ok.i.i.i - %35 = add nuw i64 %.02.i.i.i, 1 - %exitcond.not.i.i.i = icmp eq i64 %.02.i.i.i, %reass.sub.i.i.i - br i1 %exitcond.not.i.i.i, label %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit", label %mask_block_ok.i.i.i - -mask_block_ok.i.i.i: ; preds = %16, %34 - %.02.i.i.i = phi i64 [ %35, %34 ], [ 0, %16 ] - %gep.i.i.i = getelementptr i64, ptr %18, i64 %.02.i.i.i - %36 = load i64, ptr %gep.i.i.i, align 4 - %37 = icmp eq i64 %36, -1 - br i1 %37, label %34, label %mask_block_err.i.i.i - -mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") +__barray_mask_return.exit: ; preds = %__barray_check_bounds.exit + %16 = shl nuw i64 1, %13 + %17 = xor i64 %12, %16 + store i64 %17, ptr %11, align 4 + %18 = getelementptr inbounds nuw i64, ptr %4, i64 %"128_2.0" + store i64 %qalloc.i, ptr %18, align 4 + br label %cond_exit_132 + +cond_exit_132: ; preds = %loop_body, %__barray_mask_return.exit + %"2109.0" = phi i64 [ %8, %__barray_mask_return.exit ], [ %"128_2.0", %loop_body ] + %exitcond = icmp eq i64 %7, 71 + br i1 %exitcond, label %finish, label %loop_body + +loop_body394.preheader: ; preds = %loop_out + %19 = getelementptr i8, ptr %5, i64 8 + br label %__barray_check_bounds.exit1285 + +loop_out: ; preds = %finish, %__barray_mask_return.exit1279 + %20 = add nuw nsw i64 %21, 1 + %exitcond1335 = icmp eq i64 %20, 71 + br i1 %exitcond1335, label %loop_body394.preheader, label %finish + +finish: ; preds = %cond_exit_132, %loop_out + %21 = phi i64 [ %20, %loop_out ], [ 1, %cond_exit_132 ] + %"6_0.01332" = phi i64 [ %21, %loop_out ], [ 0, %cond_exit_132 ] + %remainder.urem = and i64 %"6_0.01332", 1 + %22 = icmp eq i64 %remainder.urem, 0 + br i1 %22, label %__barray_check_bounds.exit1274, label %loop_out + +__barray_check_bounds.exit1274: ; preds = %finish + %23 = lshr i64 %"6_0.01332", 6 + %24 = getelementptr inbounds nuw i64, ptr %5, i64 %23 + %25 = load i64, ptr %24, align 4 + %26 = and i64 %"6_0.01332", 62 + %27 = lshr i64 %25, %26 + %28 = trunc i64 %27 to i1 + br i1 %28, label %panic.i1275, label %__barray_check_bounds.exit1277 + +panic.i1275: ; preds = %__barray_check_bounds.exit1274 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit.i.i: ; preds = %loop_body.i, %cond_exit_82 - %.fca.2.extract.i182.i = phi i64 [ 0, %cond_exit_82 ], [ %.fca.2.extract.i.i, %loop_body.i ] - %.fca.1.extract63.i181.i = phi ptr [ %1, %cond_exit_82 ], [ %.fca.1.extract63.i.i, %loop_body.i ] - %.fca.0.extract62.i180.i = phi ptr [ %0, %cond_exit_82 ], [ %.fca.0.extract62.i.i, %loop_body.i ] - %"260_0.sroa.15.0179.i" = phi i64 [ 0, %cond_exit_82 ], [ %38, %loop_body.i ] - %.pn160178.i = phi { { ptr, ptr, i64 }, i64 } [ %13, %cond_exit_82 ], [ %56, %loop_body.i ] - %38 = add nuw nsw i64 %"260_0.sroa.15.0179.i", 1 - %39 = add i64 %"260_0.sroa.15.0179.i", %.fca.2.extract.i182.i - %40 = lshr i64 %39, 6 - %41 = getelementptr inbounds nuw i64, ptr %.fca.1.extract63.i181.i, i64 %40 - %42 = load i64, ptr %41, align 4 - %43 = and i64 %39, 63 - %44 = lshr i64 %42, %43 - %45 = trunc i64 %44 to i1 - br i1 %45, label %panic.i.i.i, label %__barray_check_bounds.exit.i - -panic.i.i.i: ; preds = %__barray_check_bounds.exit.i.i - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") +__barray_check_bounds.exit1277: ; preds = %__barray_check_bounds.exit1274 + %29 = shl nuw nsw i64 1, %26 + %30 = xor i64 %25, %29 + store i64 %30, ptr %24, align 4 + %31 = getelementptr inbounds nuw i64, ptr %4, i64 %"6_0.01332" + %32 = load i64, ptr %31, align 4 + tail call void @___rp(i64 %32, double 0x400921FB54442D18, double 0.000000e+00) + %33 = load i64, ptr %24, align 4 + %34 = lshr i64 %33, %26 + %35 = trunc i64 %34 to i1 + br i1 %35, label %__barray_mask_return.exit1279, label %panic.i1278 + +panic.i1278: ; preds = %__barray_check_bounds.exit1277 + tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -__barray_check_bounds.exit.i: ; preds = %__barray_check_bounds.exit.i.i - %46 = shl nuw i64 1, %43 - %47 = xor i64 %46, %42 - store i64 %47, ptr %41, align 4 - %48 = getelementptr inbounds i64, ptr %.fca.0.extract62.i180.i, i64 %39 - %49 = load i64, ptr %48, align 4 - %lazy_measure.i = tail call i64 @___lazy_measure(i64 %49) - tail call void @___qfree(i64 %49) - %50 = lshr i64 %"260_0.sroa.15.0179.i", 6 - %51 = getelementptr inbounds nuw i64, ptr %15, i64 %50 - %52 = load i64, ptr %51, align 4 - %53 = and i64 %"260_0.sroa.15.0179.i", 63 - %54 = lshr i64 %52, %53 - %55 = trunc i64 %54 to i1 - br i1 %55, label %loop_body.i, label %panic.i.i - -panic.i.i: ; preds = %__barray_check_bounds.exit.i +__barray_mask_return.exit1279: ; preds = %__barray_check_bounds.exit1277 + %36 = xor i64 %33, %29 + store i64 %36, ptr %24, align 4 + store i64 %32, ptr %31, align 4 + br label %loop_out + +out_of_bounds.i1280: ; preds = %.thread + tail call void @panic(i32 1002, ptr nonnull @"e_Index out .DD115165.0") + unreachable + +__barray_check_bounds.exit1281: ; preds = %.thread + %37 = lshr i64 %"251_2.01341", 6 + %38 = getelementptr inbounds nuw i64, ptr %3, i64 %37 + %39 = load i64, ptr %38, align 4 + %40 = and i64 %"251_2.01341", 63 + %41 = lshr i64 %39, %40 + %42 = trunc i64 %41 to i1 + br i1 %42, label %cond_exit_255, label %panic.i1282 + +panic.i1282: ; preds = %__barray_check_bounds.exit1281 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i: ; preds = %__barray_check_bounds.exit.i - %56 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, i64 %38, 1 - %57 = shl nuw i64 1, %53 - %58 = xor i64 %52, %57 - store i64 %58, ptr %51, align 4 - %59 = getelementptr inbounds nuw i64, ptr %14, i64 %"260_0.sroa.15.0179.i" - store i64 %lazy_measure.i, ptr %59, align 4 - %60 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160178.i, 0 - %.fca.0.extract62.i.i = extractvalue { ptr, ptr, i64 } %60, 0 - %.fca.1.extract63.i.i = extractvalue { ptr, ptr, i64 } %60, 1 - %.fca.2.extract.i.i = extractvalue { ptr, ptr, i64 } %60, 2 - %exitcond.not.i = icmp eq i64 %38, 70 - br i1 %exitcond.not.i, label %16, label %__barray_check_bounds.exit.i.i - -"__hugr__.guppylang.std.quantum.measure_array$70.246.exit": ; preds = %34, %16 - tail call void @heap_free(ptr %.fca.0.extract62.i.i) - tail call void @heap_free(ptr nonnull %.fca.1.extract63.i.i) - %"124.fca.0.insert.i" = insertvalue { ptr, ptr, i64 } poison, ptr %14, 0 - %"124.fca.1.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.0.insert.i", ptr %15, 1 - %"124.fca.2.insert.i" = insertvalue { ptr, ptr, i64 } %"124.fca.1.insert.i", i64 0, 2 - %61 = insertvalue { { ptr, ptr, i64 }, i64 } poison, { ptr, ptr, i64 } %"124.fca.2.insert.i", 0 - %62 = tail call ptr @heap_alloc(i64 70) - %63 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %63, i8 -1, i64 16, i1 false) - br label %__barray_check_bounds.exit.i.i526 - -loop_body.preheader.i.i: ; preds = %loop_body.i529 - %"522_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 2 - %"522_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 1 - %"522_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %124, 0 - br label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i.i526: ; preds = %loop_body.i529, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" - %64 = phi { ptr, ptr, i64 } [ %"124.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %124, %loop_body.i529 ] - %"301_0.sroa.15.0169.i" = phi i64 [ 0, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %65, %loop_body.i529 ] - %.pn160168.i = phi { { ptr, ptr, i64 }, i64 } [ %61, %"__hugr__.guppylang.std.quantum.measure_array$70.246.exit" ], [ %120, %loop_body.i529 ] - %65 = add nuw nsw i64 %"301_0.sroa.15.0169.i", 1 - %.fca.2.extract208.i.i = extractvalue { ptr, ptr, i64 } %64, 2 - %.fca.1.extract207.i.i = extractvalue { ptr, ptr, i64 } %64, 1 - %66 = add i64 %.fca.2.extract208.i.i, %"301_0.sroa.15.0169.i" - %67 = lshr i64 %66, 6 - %68 = getelementptr inbounds nuw i64, ptr %.fca.1.extract207.i.i, i64 %67 +mask_block_ok.i: ; preds = %cond_exit_255 + %43 = load i64, ptr %19, align 4 + %44 = or i64 %43, -64 + store i64 %44, ptr %19, align 4 + %45 = load i64, ptr %5, align 4 + %46 = icmp eq i64 %45, -1 + %47 = icmp eq i64 %44, -1 + %or.cond = select i1 %46, i1 %47, i1 false + br i1 %or.cond, label %loop_body503.preheader.preheader, label %mask_block_err.i + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1285: ; preds = %loop_body394.preheader, %cond_exit_255 + %"251_0.sroa.15.01342" = phi i64 [ 0, %loop_body394.preheader ], [ %48, %cond_exit_255 ] + %"251_2.01341" = phi i64 [ 0, %loop_body394.preheader ], [ %59, %cond_exit_255 ] + %48 = add nuw nsw i64 %"251_0.sroa.15.01342", 1 + %49 = lshr i64 %"251_0.sroa.15.01342", 6 + %50 = getelementptr inbounds nuw i64, ptr %5, i64 %49 + %51 = load i64, ptr %50, align 4 + %52 = and i64 %"251_0.sroa.15.01342", 63 + %53 = lshr i64 %51, %52 + %54 = trunc i64 %53 to i1 + br i1 %54, label %panic.i1286, label %.thread + +panic.i1286: ; preds = %__barray_check_bounds.exit1285 + tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") + unreachable + +.thread: ; preds = %__barray_check_bounds.exit1285 + %55 = shl nuw i64 1, %52 + %56 = xor i64 %51, %55 + store i64 %56, ptr %50, align 4 + %57 = getelementptr inbounds nuw i64, ptr %4, i64 %"251_0.sroa.15.01342" + %58 = load i64, ptr %57, align 4 + %59 = add i64 %"251_2.01341", 1 + %lazy_measure = tail call i64 @___lazy_measure(i64 %58) + tail call void @___qfree(i64 %58) + %60 = icmp ult i64 %"251_2.01341", 70 + br i1 %60, label %__barray_check_bounds.exit1281, label %out_of_bounds.i1280 + +cond_exit_255: ; preds = %__barray_check_bounds.exit1281 + %61 = shl nuw i64 1, %40 + %62 = xor i64 %39, %61 + store i64 %62, ptr %38, align 4 + %63 = getelementptr inbounds nuw i64, ptr %2, i64 %"251_2.01341" + store i64 %lazy_measure, ptr %63, align 4 + %64 = icmp samesign ugt i64 %"251_0.sroa.15.01342", 68 + br i1 %64, label %mask_block_ok.i, label %__barray_check_bounds.exit1285 + +loop_body503.preheader.preheader: ; preds = %mask_block_ok.i + tail call void @heap_free(ptr %4) + tail call void @heap_free(ptr nonnull %5) + br label %__barray_check_bounds.exit1289 + +loop_body607.preheader: ; preds = %cond_exit_321 + %65 = getelementptr i8, ptr %3, i64 8 + br label %__barray_check_bounds.exit1307 + +__barray_check_bounds.exit1289: ; preds = %cond_exit_321, %loop_body503.preheader.preheader + %"317_0.sroa.15.01334" = phi i64 [ %66, %cond_exit_321 ], [ 0, %loop_body503.preheader.preheader ] + %66 = add nuw nsw i64 %"317_0.sroa.15.01334", 1 + %67 = lshr i64 %"317_0.sroa.15.01334", 6 + %68 = getelementptr inbounds nuw i64, ptr %3, i64 %67 %69 = load i64, ptr %68, align 4 - %70 = and i64 %66, 63 + %70 = and i64 %"317_0.sroa.15.01334", 63 %71 = lshr i64 %69, %70 %72 = trunc i64 %71 to i1 - br i1 %72, label %panic.i.i.i542, label %__barray_check_bounds.exit221.i.i + br i1 %72, label %panic.i1290, label %__barray_check_bounds.exit1293 -panic.i.i.i542: ; preds = %__barray_check_bounds.exit.i.i526 +panic.i1290: ; preds = %__barray_check_bounds.exit1289 tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") unreachable -__barray_check_bounds.exit221.i.i: ; preds = %__barray_check_bounds.exit.i.i526 - %.fca.0.extract206.i.i = extractvalue { ptr, ptr, i64 } %64, 0 +__barray_check_bounds.exit1293: ; preds = %__barray_check_bounds.exit1289 %73 = shl nuw i64 1, %70 - %74 = xor i64 %73, %69 + %74 = xor i64 %69, %73 store i64 %74, ptr %68, align 4 - %75 = getelementptr inbounds i64, ptr %.fca.0.extract206.i.i, i64 %66 + %75 = getelementptr inbounds nuw i64, ptr %2, i64 %"317_0.sroa.15.01334" %76 = load i64, ptr %75, align 4 tail call void @___inc_future_refcount(i64 %76) %77 = load i64, ptr %68, align 4 %78 = lshr i64 %77, %70 %79 = trunc i64 %78 to i1 - br i1 %79, label %__barray_check_bounds.exit.i527, label %panic.i222.i.i + br i1 %79, label %__barray_check_bounds.exit1297, label %panic.i1294 -panic.i222.i.i: ; preds = %__barray_check_bounds.exit221.i.i +panic.i1294: ; preds = %__barray_check_bounds.exit1293 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_525_case_0.i.i: ; preds = %cond_exit_525.thread.i.i - %80 = lshr i64 %"522_1.sroa.10.0.i.i", 6 - %81 = getelementptr i64, ptr %"522_1.sroa.5.0.i.i", i64 %80 - %82 = load i64, ptr %81, align 4 - %83 = and i64 %"522_1.sroa.10.0.i.i", 63 - %84 = sub nuw nsw i64 64, %83 - %85 = lshr i64 -1, %84 - %86 = icmp eq i64 %83, 0 - %87 = select i1 %86, i64 0, i64 %85 - %88 = or i64 %82, %87 - store i64 %88, ptr %81, align 4 - %last_valid.i.i.i531 = add i64 %"522_1.sroa.10.0.i.i", 69 - %89 = lshr i64 %last_valid.i.i.i531, 6 - %90 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %89 - %91 = load i64, ptr %90, align 4 - %92 = and i64 %last_valid.i.i.i531, 63 - %93 = shl nsw i64 -2, %92 - %94 = icmp eq i64 %92, 63 - %95 = select i1 %94, i64 0, i64 %93 - %96 = or i64 %91, %95 - store i64 %96, ptr %90, align 4 - %reass.sub.i.i.i532 = sub nsw i64 %89, %80 - %.not.i.i.i533 = icmp eq i64 %reass.sub.i.i.i532, -1 - br i1 %.not.i.i.i533, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -97: ; preds = %mask_block_ok.i.i.i534 - %98 = add nuw i64 %.02.i.i.i535, 1 - %exitcond.not.i.i.i538 = icmp eq i64 %.02.i.i.i535, %reass.sub.i.i.i532 - br i1 %exitcond.not.i.i.i538, label %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit", label %mask_block_ok.i.i.i534 - -mask_block_ok.i.i.i534: ; preds = %cond_525_case_0.i.i, %97 - %.02.i.i.i535 = phi i64 [ %98, %97 ], [ 0, %cond_525_case_0.i.i ] - %gep.i.i.i536 = getelementptr i64, ptr %81, i64 %.02.i.i.i535 - %99 = load i64, ptr %gep.i.i.i536, align 4 - %100 = icmp eq i64 %99, -1 - br i1 %100, label %97, label %mask_block_err.i.i.i537 - -mask_block_err.i.i.i537: ; preds = %mask_block_ok.i.i.i534 - tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") - unreachable - -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_525.thread.i.i, %loop_body.preheader.i.i - %"522_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %101, %cond_exit_525.thread.i.i ] - %101 = add nuw nsw i64 %"522_0.0239.i.i", 1 - %102 = add i64 %"522_0.0239.i.i", %"522_1.sroa.10.0.i.i" - %103 = lshr i64 %102, 6 - %104 = getelementptr inbounds nuw i64, ptr %"522_1.sroa.5.0.i.i", i64 %103 - %105 = load i64, ptr %104, align 4 - %106 = and i64 %102, 63 - %107 = lshr i64 %105, %106 - %108 = trunc i64 %107 to i1 - br i1 %108, label %cond_exit_525.thread.i.i, label %__barray_mask_borrow.exit228.i.i - -__barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i - %109 = shl nuw i64 1, %106 - %110 = xor i64 %109, %105 - store i64 %110, ptr %104, align 4 - %111 = getelementptr inbounds i64, ptr %"522_1.sroa.0.0.i.i", i64 %102 - %112 = load i64, ptr %111, align 4 - tail call void @___dec_future_refcount(i64 %112) - br label %cond_exit_525.thread.i.i - -cond_exit_525.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i - %exitcond.i.i = icmp eq i64 %101, 70 - br i1 %exitcond.i.i, label %cond_525_case_0.i.i, label %__barray_check_bounds.exit224.i.i - -__barray_check_bounds.exit.i527: ; preds = %__barray_check_bounds.exit221.i.i - %113 = xor i64 %77, %73 - store i64 %113, ptr %68, align 4 +__barray_check_bounds.exit1297: ; preds = %__barray_check_bounds.exit1293 + %80 = xor i64 %77, %73 + store i64 %80, ptr %68, align 4 store i64 %76, ptr %75, align 4 - %read_bool.i = tail call i1 @___read_future_bool(i64 %76) + %read_bool = tail call i1 @___read_future_bool(i64 %76) tail call void @___dec_future_refcount(i64 %76) - %114 = lshr i64 %"301_0.sroa.15.0169.i", 6 - %115 = getelementptr inbounds nuw i64, ptr %63, i64 %114 - %116 = load i64, ptr %115, align 4 - %117 = and i64 %"301_0.sroa.15.0169.i", 63 - %118 = lshr i64 %116, %117 - %119 = trunc i64 %118 to i1 - br i1 %119, label %loop_body.i529, label %panic.i.i528 - -panic.i.i528: ; preds = %__barray_check_bounds.exit.i527 + %81 = getelementptr inbounds nuw i64, ptr %1, i64 %67 + %82 = load i64, ptr %81, align 4 + %83 = lshr i64 %82, %70 + %84 = trunc i64 %83 to i1 + br i1 %84, label %cond_exit_321, label %panic.i1298 + +panic.i1298: ; preds = %__barray_check_bounds.exit1297 tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -loop_body.i529: ; preds = %__barray_check_bounds.exit.i527 - %120 = insertvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, i64 %65, 1 - %121 = shl nuw i64 1, %117 - %122 = xor i64 %116, %121 - store i64 %122, ptr %115, align 4 - %123 = getelementptr inbounds nuw i1, ptr %62, i64 %"301_0.sroa.15.0169.i" - store i1 %read_bool.i, ptr %123, align 1 - %124 = extractvalue { { ptr, ptr, i64 }, i64 } %.pn160168.i, 0 - %exitcond.not.i530 = icmp eq i64 %65, 70 - br i1 %exitcond.not.i530, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i526 - -"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit": ; preds = %97, %cond_525_case_0.i.i - tail call void @heap_free(ptr %"522_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"522_1.sroa.5.0.i.i") - %125 = getelementptr inbounds nuw i8, ptr %63, i64 8 - %126 = load i64, ptr %125, align 4 - %127 = and i64 %126, 63 - store i64 %127, ptr %125, align 4 - %128 = load i64, ptr %63, align 4 - %129 = icmp eq i64 %128, 0 - %130 = icmp eq i64 %127, 0 - %or.cond.i = select i1 %129, i1 %130, i1 false - br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i - -mask_block_err.i: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" +cond_482_case_0: ; preds = %cond_exit_482 + %85 = load i64, ptr %65, align 4 + %86 = or i64 %85, -64 + store i64 %86, ptr %65, align 4 + %87 = load i64, ptr %3, align 4 + %88 = icmp eq i64 %87, -1 + %89 = icmp eq i64 %86, -1 + %or.cond1340 = select i1 %88, i1 %89, i1 false + br i1 %or.cond1340, label %loop_out502, label %mask_block_err.i1303 + +mask_block_err.i1303: ; preds = %cond_482_case_0 + tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") + unreachable + +__barray_check_bounds.exit1307: ; preds = %loop_body607.preheader, %cond_exit_482 + %"479_0.01343" = phi i64 [ 0, %loop_body607.preheader ], [ %90, %cond_exit_482 ] + %90 = add nuw nsw i64 %"479_0.01343", 1 + %91 = lshr i64 %"479_0.01343", 6 + %92 = getelementptr inbounds nuw i64, ptr %3, i64 %91 + %93 = load i64, ptr %92, align 4 + %94 = and i64 %"479_0.01343", 63 + %95 = lshr i64 %93, %94 + %96 = trunc i64 %95 to i1 + br i1 %96, label %cond_exit_482, label %__barray_mask_borrow.exit1311 + +__barray_mask_borrow.exit1311: ; preds = %__barray_check_bounds.exit1307 + %97 = shl nuw i64 1, %94 + %98 = xor i64 %93, %97 + store i64 %98, ptr %92, align 4 + %99 = getelementptr inbounds nuw i64, ptr %2, i64 %"479_0.01343" + %100 = load i64, ptr %99, align 4 + tail call void @___dec_future_refcount(i64 %100) + br label %cond_exit_482 + +cond_exit_482: ; preds = %__barray_mask_borrow.exit1311, %__barray_check_bounds.exit1307 + %101 = icmp samesign ugt i64 %"479_0.01343", 68 + br i1 %101, label %cond_482_case_0, label %__barray_check_bounds.exit1307 + +cond_exit_321: ; preds = %__barray_check_bounds.exit1297 + %102 = xor i64 %82, %73 + store i64 %102, ptr %81, align 4 + %103 = getelementptr inbounds nuw i1, ptr %0, i64 %"317_0.sroa.15.01334" + store i1 %read_bool, ptr %103, align 1 + %104 = icmp eq i64 %"317_0.sroa.15.01334", 69 + br i1 %104, label %loop_body607.preheader, label %__barray_check_bounds.exit1289 + +loop_out502: ; preds = %cond_482_case_0 + tail call void @heap_free(ptr %2) + tail call void @heap_free(ptr nonnull %3) + %105 = getelementptr inbounds nuw i8, ptr %1, i64 8 + %106 = load i64, ptr %105, align 4 + %107 = and i64 %106, 63 + store i64 %107, ptr %105, align 4 + %108 = load i64, ptr %1, align 4 + %109 = icmp eq i64 %108, 0 + %110 = icmp eq i64 %107, 0 + %or.cond.i = select i1 %109, i1 %110, i1 false + br i1 %or.cond.i, label %__barray_check_none_borrowed.exit, label %mask_block_err.i1313 + +mask_block_err.i1313: ; preds = %loop_out502 tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit: ; preds = %"__hugr__.guppylang.std.quantum.collect_measurements$70.287.exit" - %131 = tail call ptr @heap_alloc(i64 70) - %132 = tail call ptr @heap_alloc(i64 16) - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %132, i8 0, i64 16, i1 false) - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %131, ptr noundef nonnull align 1 dereferenceable(70) %62, i64 70, i1 false) - tail call void @heap_free(ptr nonnull %131) - %133 = load i64, ptr %125, align 4 - %134 = and i64 %133, 63 - store i64 %134, ptr %125, align 4 - %135 = load i64, ptr %63, align 4 - %136 = icmp eq i64 %135, 0 - %137 = icmp eq i64 %134, 0 - %or.cond.i543 = select i1 %136, i1 %137, i1 false - br i1 %or.cond.i543, label %__barray_check_none_borrowed.exit545, label %mask_block_err.i544 - -mask_block_err.i544: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit: ; preds = %loop_out502 + %111 = tail call ptr @heap_alloc(i64 70) + %112 = tail call ptr @heap_alloc(i64 16) + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %112, i8 0, i64 16, i1 false) + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %111, ptr noundef nonnull align 1 dereferenceable(70) %0, i64 70, i1 false) + tail call void @heap_free(ptr nonnull %111) + %113 = load i64, ptr %105, align 4 + %114 = and i64 %113, 63 + store i64 %114, ptr %105, align 4 + %115 = load i64, ptr %1, align 4 + %116 = icmp eq i64 %115, 0 + %117 = icmp eq i64 %114, 0 + %or.cond.i1315 = select i1 %116, i1 %117, i1 false + br i1 %or.cond.i1315, label %__barray_check_none_borrowed.exit1317, label %mask_block_err.i1316 + +mask_block_err.i1316: ; preds = %__barray_check_none_borrowed.exit tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0") unreachable -__barray_check_none_borrowed.exit545: ; preds = %__barray_check_none_borrowed.exit +__barray_check_none_borrowed.exit1317: ; preds = %__barray_check_none_borrowed.exit %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8 %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4 %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8 %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16 - %138 = alloca [70 x i1], align 1 - call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %138, i8 0, i64 70, i1 false) + %118 = alloca [70 x i1], align 1 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(70) %118, i8 0, i64 70, i1 false) store i32 70, ptr %out_arr_alloca, align 8 store i32 1, ptr %y_ptr, align 4 - store ptr %62, ptr %arr_ptr, align 8 - store ptr %138, ptr %mask_ptr, align 8 + store ptr %0, ptr %arr_ptr, align 8 + store ptr %118, ptr %mask_ptr, align 8 call void @print_bool_arr(ptr nonnull @res_bools.B1D99BB9.0, i64 18, ptr nonnull %out_arr_alloca) ret void - -finish: ; preds = %loop_out, %2 - %"47_0.0567" = phi i64 [ 0, %loop_out ], [ %139, %2 ] - %139 = add nuw nsw i64 %"47_0.0567", 1 - %remainder.urem = and i64 %"47_0.0567", 1 - %140 = icmp eq i64 %remainder.urem, 0 - br i1 %140, label %__barray_check_bounds.exit547, label %2 - -__barray_check_bounds.exit547: ; preds = %finish - %141 = lshr i64 %"47_0.0567", 6 - %142 = getelementptr inbounds nuw i64, ptr %1, i64 %141 - %143 = load i64, ptr %142, align 4 - %144 = and i64 %"47_0.0567", 62 - %145 = lshr i64 %143, %144 - %146 = trunc i64 %145 to i1 - br i1 %146, label %panic.i548, label %__barray_check_bounds.exit550 - -panic.i548: ; preds = %__barray_check_bounds.exit547 - tail call void @panic(i32 1002, ptr nonnull @"e_Array elem.E746B1A3.0") - unreachable - -__barray_check_bounds.exit550: ; preds = %__barray_check_bounds.exit547 - %147 = shl nuw nsw i64 1, %144 - %148 = xor i64 %143, %147 - store i64 %148, ptr %142, align 4 - %149 = getelementptr inbounds nuw i64, ptr %0, i64 %"47_0.0567" - %150 = load i64, ptr %149, align 4 - tail call void @___rp(i64 %150, double 0x400921FB54442D18, double 0.000000e+00) - %151 = load i64, ptr %142, align 4 - %152 = lshr i64 %151, %144 - %153 = trunc i64 %152 to i1 - br i1 %153, label %__barray_mask_return.exit552, label %panic.i551 - -panic.i551: ; preds = %__barray_check_bounds.exit550 - tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") - unreachable - -__barray_mask_return.exit552: ; preds = %__barray_check_bounds.exit550 - %154 = xor i64 %151, %147 - store i64 %154, ptr %142, align 4 - store i64 %150, ptr %149, align 4 - br label %2 } declare ptr @heap_alloc(i64) local_unnamed_addr @@ -414,22 +356,22 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: noreturn declare void @panic(i32, ptr) local_unnamed_addr #1 -; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 - declare void @heap_free(ptr) local_unnamed_addr -declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr - declare i64 @___lazy_measure(i64) local_unnamed_addr declare void @___qfree(i64) local_unnamed_addr -declare i1 @___read_future_bool(i64) local_unnamed_addr +declare void @___inc_future_refcount(i64) local_unnamed_addr declare void @___dec_future_refcount(i64) local_unnamed_addr -declare void @___inc_future_refcount(i64) local_unnamed_addr +declare i1 @___read_future_bool(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 + +declare void @print_bool_arr(ptr, i64, ptr) local_unnamed_addr declare void @___rp(i64, double, double) local_unnamed_addr diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-apple-darwin.ll index c88063c9..0c961d3e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-unknown-linux-gnu.ll index 582f6c08..2fefffd7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-apple-darwin.ll index 7c7971ec..f95ebc14 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-unknown-linux-gnu.ll index 4463f3b7..f59902e7 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-windows-gnu.ll index 0bc09657..62a09e02 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-helios-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_helios_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-apple-darwin.ll index 21fd8994..e98c236e 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-unknown-linux-gnu.ll index 9ed8c7e8..931e2eb8 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-aarch64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-apple-darwin.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-apple-darwin.ll index 2b840add..21fa8787 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-apple-darwin.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-apple-darwin.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-unknown-linux-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-unknown-linux-gnu.ll index e09da1bc..74082299 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-unknown-linux-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-unknown-linux-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-windows-gnu.ll b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-windows-gnu.ll index 8c0333bb..4de6fbba 100644 --- a/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-windows-gnu.ll +++ b/selene-sim/python/tests/resources/from_guppy/test_unparsed/test_panic_unparsed/panic_unparsed-sol-x86_64-windows-gnu.ll @@ -11,13 +11,13 @@ define void @__hugr__.__main__.main.1() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit + br i1 %not_max.not.not.i, label %cond_36_case_0.i, label %__hugr__.__tk2_sol_qalloc.32.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_36_case_0.i: ; preds = %alloca_block tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.32.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure) br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.32.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_100pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_100pc index f1aaa88f..622e52c6 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_100pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_100pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 244 +: 673 ? !!python/tuple - false - true -: 275 +: 0 ? !!python/tuple - true - false -: 253 +: 327 ? !!python/tuple - true - true -: 228 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_1pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_1pc index 3ba3572c..8f961737 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_1pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_1pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 14 +: 8 ? !!python/tuple - false - true -: 7 +: 0 ? !!python/tuple - true - false -: 938 +: 992 ? !!python/tuple - true - true -: 41 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_25pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_25pc index 13c2745c..da22cb53 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_25pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_25pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 191 +: 179 ? !!python/tuple - false - true -: 190 +: 0 ? !!python/tuple - true - false -: 344 +: 821 ? !!python/tuple - true - true -: 275 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_50pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_50pc index a7aef1ae..dce17e3f 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_50pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_1q_error/counts_p1q_50pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 275 +: 345 ? !!python/tuple - false - true -: 234 +: 0 ? !!python/tuple - true - false -: 265 +: 655 ? !!python/tuple - true - true -: 226 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_100pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_100pc index 85a27fc4..d0f24151 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_100pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_100pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 246 +: 0 ? !!python/tuple - false - true -: 233 +: 0 ? !!python/tuple - true - false -: 261 +: 1000 ? !!python/tuple - true - true -: 260 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_1pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_1pc index 292129b3..d0f24151 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_1pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_1pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 5 +: 0 ? !!python/tuple - false - true -: 12 +: 0 ? !!python/tuple - true - false -: 978 +: 1000 ? !!python/tuple - true - true -: 5 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_25pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_25pc index 9fdb80dd..d0f24151 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_25pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_25pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 107 +: 0 ? !!python/tuple - false - true -: 121 +: 0 ? !!python/tuple - true - false -: 653 +: 1000 ? !!python/tuple - true - true -: 119 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_50pc b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_50pc index cbf54852..d0f24151 100644 --- a/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_50pc +++ b/selene-sim/python/tests/snapshots/test_depolarising_error_model/test_2q_error/counts_p2q_50pc @@ -1,16 +1,16 @@ ? !!python/tuple - false - false -: 203 +: 0 ? !!python/tuple - false - true -: 184 +: 0 ? !!python/tuple - true - false -: 419 +: 1000 ? !!python/tuple - true - true -: 194 +: 0 diff --git a/selene-sim/python/tests/snapshots/test_guppy/test_rng/rng b/selene-sim/python/tests/snapshots/test_guppy/test_rng/rng index 64f4e387..9a3946c8 100644 --- a/selene-sim/python/tests/snapshots/test_guppy/test_rng/rng +++ b/selene-sim/python/tests/snapshots/test_guppy/test_rng/rng @@ -1,7 +1,7 @@ rfloat: 0.18373215361498296 -rfloat2: 0.7466911864466965 +rfloat2: 0.41753021418116987 rint: 1085446021 rint1: 176895750 -rint2: -952414024 +rint2: -65901028 rint_bnd: 45 -rint_bnd2: 137 +rint_bnd2: 65 diff --git a/selene-sim/python/tests/snapshots/test_multiplatform/test_multiplatform/add_3_11/add_3_11.yaml b/selene-sim/python/tests/snapshots/test_multiplatform/test_multiplatform/add_3_11/add_3_11.yaml deleted file mode 100644 index a008cedd..00000000 --- a/selene-sim/python/tests/snapshots/test_multiplatform/test_multiplatform/add_3_11/add_3_11.yaml +++ /dev/null @@ -1,18002 +0,0 @@ -helios: -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -sol: -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 -- - !!python/tuple - - b_reg - - - 0 - - 1 - - 1 - - 1 - - !!python/tuple - - carry_out - - 0 diff --git a/selene-sim/python/tests/snapshots/test_multiplatform/test_multiplatform_circuit_log/add_3_11/add_3_11_circuits.yaml b/selene-sim/python/tests/snapshots/test_multiplatform/test_multiplatform_circuit_log/add_3_11/add_3_11_circuits.yaml deleted file mode 100644 index 76b90c24..00000000 --- a/selene-sim/python/tests/snapshots/test_multiplatform/test_multiplatform_circuit_log/add_3_11/add_3_11_circuits.yaml +++ /dev/null @@ -1,190 +0,0 @@ -helios: '[Reset q[0]; Reset q[1]; Reset q[2]; Reset q[3]; Reset q[4]; Reset q[5]; - Reset q[6]; Reset q[7]; Reset q[8]; Reset q[9]; PhasedX(1, 0) q[0]; PhasedX(1, 0) - q[1]; PhasedX(1, 0) q[4]; PhasedX(1, 0) q[5]; PhasedX(3.5, 0.5) q[6]; PhasedX(1, - 0) q[7]; PhasedX(3.5, 0.5) q[8]; PhasedX(3.5, 0.5) q[9]; ZZPhase(0.5) q[2], q[6]; - PhasedX(3.5, 0.5) q[5]; PhasedX(3.5, 0.5) q[7]; ZZPhase(0.5) q[1], q[5]; Rz(3.5) - q[2]; ZZPhase(0.5) q[3], q[7]; PhasedX(0.5, 1) q[6]; Rz(3.5) q[1]; Rz(3.5) q[3]; - PhasedX(0.5, 1) q[5]; Rz(3.5) q[6]; PhasedX(0.5, 1) q[7]; ZZPhase(0.5) q[1], q[9]; - Rz(3.5) q[5]; Rz(3.5) q[7]; Rz(3.5) q[1]; PhasedX(0.5, 1) q[9]; PhasedX(3.5, 0.5) - q[1]; Rz(3.5) q[9]; ZZPhase(0.5) q[2], q[1]; PhasedX(0.5, 1.5) q[9]; PhasedX(0.5, - 1) q[1]; Rz(3.5) q[2]; Rz(1) q[9]; Rz(3.5) q[1]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, - 0.5) q[9]; ZZPhase(0.5) q[0], q[9]; PhasedX(0.5, 1.5) q[1]; ZZPhase(0.5) q[3], q[2]; - Rz(3.5) q[0]; Rz(1) q[1]; PhasedX(0.5, 1) q[2]; Rz(3.5) q[3]; PhasedX(0.5, 1) q[9]; - PhasedX(3.5, 0.5) q[1]; Rz(3.5) q[2]; ZZPhase(0.5) q[3], q[8]; Rz(3.5) q[9]; ZZPhase(0.5) - q[5], q[1]; PhasedX(0.5, 1.5) q[2]; Rz(3.5) q[3]; PhasedX(0.5, 1) q[8]; Rz(3.75) - q[9]; PhasedX(0.5, 1) q[1]; Rz(1) q[2]; Rz(3.5) q[5]; Rz(3.5) q[8]; PhasedX(3.5, - 0.5) q[9]; Rz(3.5) q[1]; PhasedX(3.5, 0.5) q[2]; ZZPhase(0.5) q[4], q[9]; PhasedX(0.5, - 1.5) q[8]; Rz(3.75) q[1]; ZZPhase(0.5) q[6], q[2]; Rz(3.5) q[4]; Rz(1) q[8]; PhasedX(0.5, - 1) q[9]; PhasedX(3.5, 0.5) q[1]; PhasedX(0.5, 1) q[2]; Rz(3.5) q[6]; PhasedX(3.5, - 0.5) q[8]; Rz(3.5) q[9]; Rz(3.5) q[2]; ZZPhase(0.5) q[7], q[8]; Rz(0.25) q[9]; Rz(3.75) - q[2]; Rz(3.5) q[7]; PhasedX(0.5, 1) q[8]; PhasedX(3.5, 0.5) q[9]; ZZPhase(0.5) q[0], - q[9]; PhasedX(3.5, 0.5) q[2]; Rz(3.5) q[8]; Rz(3.5) q[0]; Rz(3.75) q[8]; PhasedX(0.5, - 1) q[9]; Rz(0.25) q[0]; PhasedX(3.5, 0.5) q[8]; Rz(3.5) q[9]; PhasedX(3.5, 0.5) - q[0]; Rz(3.75) q[9]; PhasedX(3.5, 0.5) q[9]; ZZPhase(0.5) q[4], q[9]; Rz(3.5) q[4]; - PhasedX(0.5, 1) q[9]; ZZPhase(0.5) q[4], q[0]; Rz(3.5) q[9]; PhasedX(0.5, 1) q[0]; - Rz(3.5) q[4]; Rz(0.25) q[9]; Rz(3.5) q[0]; Rz(0.25) q[4]; PhasedX(0.5, 1.5) q[9]; - Rz(3.75) q[0]; Rz(1) q[9]; PhasedX(3.5, 0.5) q[0]; ZZPhase(0.5) q[9], q[1]; ZZPhase(0.5) - q[4], q[0]; PhasedX(0.5, 1) q[1]; Rz(3.5) q[9]; PhasedX(0.5, 1) q[0]; Rz(3.5) q[1]; - Rz(3.5) q[4]; Rz(3.5) q[0]; Rz(0.25) q[1]; PhasedX(3.5, 0.5) q[1]; ZZPhase(0.5) - q[5], q[1]; PhasedX(0.5, 1) q[1]; Rz(3.5) q[5]; Rz(3.5) q[1]; Rz(0.25) q[5]; Rz(3.75) - q[1]; PhasedX(3.5, 0.5) q[5]; PhasedX(3.5, 0.5) q[1]; ZZPhase(0.5) q[9], q[1]; PhasedX(0.5, - 1) q[1]; Rz(3.5) q[9]; Rz(3.5) q[1]; ZZPhase(0.5) q[9], q[5]; Rz(0.25) q[1]; PhasedX(0.5, - 1) q[5]; Rz(3.5) q[9]; PhasedX(0.5, 1.5) q[1]; Rz(3.5) q[5]; Rz(0.25) q[9]; Rz(1) - q[1]; Rz(3.75) q[5]; ZZPhase(0.5) q[1], q[2]; PhasedX(3.5, 0.5) q[5]; Rz(3.5) q[1]; - PhasedX(0.5, 1) q[2]; ZZPhase(0.5) q[9], q[5]; Rz(3.5) q[2]; PhasedX(0.5, 1) q[5]; - Rz(3.5) q[9]; Rz(0.25) q[2]; Rz(3.5) q[5]; PhasedX(3.5, 0.5) q[2]; PhasedX(1, 0) - q[5]; ZZPhase(0.5) q[6], q[2]; PhasedX(3.5, 0.5) q[5]; PhasedX(0.5, 1) q[2]; ZZPhase(0.5) - q[9], q[5]; Rz(3.5) q[6]; Rz(3.5) q[2]; PhasedX(0.5, 1) q[5]; Rz(0.25) q[6]; Rz(3.5) - q[9]; Rz(3.75) q[2]; Rz(3.5) q[5]; PhasedX(3.5, 0.5) q[6]; PhasedX(3.5, 0.5) q[2]; - ZZPhase(0.5) q[1], q[2]; Rz(3.5) q[1]; PhasedX(0.5, 1) q[2]; ZZPhase(0.5) q[1], - q[6]; Rz(3.5) q[2]; Rz(3.5) q[1]; Rz(0.25) q[2]; PhasedX(0.5, 1) q[6]; Rz(0.25) - q[1]; PhasedX(0.5, 1.5) q[2]; Rz(3.5) q[6]; Rz(1) q[2]; Rz(3.75) q[6]; ZZPhase(0.5) - q[2], q[8]; PhasedX(3.5, 0.5) q[6]; ZZPhase(0.5) q[1], q[6]; Rz(3.5) q[2]; PhasedX(0.5, - 1) q[8]; Rz(3.5) q[1]; PhasedX(0.5, 1) q[6]; Rz(3.5) q[8]; Rz(3.5) q[6]; Rz(0.25) - q[8]; PhasedX(1, 0) q[6]; PhasedX(3.5, 0.5) q[8]; PhasedX(3.5, 0.5) q[6]; ZZPhase(0.5) - q[7], q[8]; ZZPhase(0.5) q[1], q[6]; Rz(3.5) q[7]; PhasedX(0.5, 1) q[8]; Rz(3.5) - q[1]; PhasedX(0.5, 1) q[6]; Rz(0.25) q[7]; Rz(3.5) q[8]; Rz(3.5) q[6]; PhasedX(3.5, - 0.5) q[7]; Rz(3.75) q[8]; PhasedX(3.5, 0.5) q[8]; ZZPhase(0.5) q[2], q[8]; Rz(3.5) - q[2]; PhasedX(0.5, 1) q[8]; ZZPhase(0.5) q[2], q[7]; Rz(3.5) q[8]; Rz(3.5) q[2]; - PhasedX(0.5, 1) q[7]; Rz(0.25) q[8]; Rz(0.25) q[2]; Rz(3.5) q[7]; PhasedX(0.5, 1.5) - q[8]; Rz(3.75) q[7]; Rz(1) q[8]; Measure q[8] --> c[8]; PhasedX(3.5, 0.5) q[7]; - ZZPhase(0.5) q[2], q[7]; Rz(3.5) q[2]; PhasedX(0.5, 1) q[7]; Rz(3.5) q[7]; PhasedX(3.5, - 0.5) q[7]; ZZPhase(0.5) q[2], q[7]; Rz(3.5) q[2]; PhasedX(0.5, 1) q[7]; PhasedX(0.5, - 1.5) q[2]; Rz(3.5) q[7]; Rz(1) q[2]; PhasedX(3.5, 0.5) q[7]; PhasedX(3.5, 0.5) q[2]; - ZZPhase(0.5) q[6], q[2]; PhasedX(0.5, 1) q[2]; Rz(3.5) q[6]; Rz(3.5) q[2]; Rz(3.75) - q[2]; PhasedX(3.5, 0.5) q[2]; ZZPhase(0.5) q[1], q[2]; Rz(3.5) q[1]; PhasedX(0.5, - 1) q[2]; Rz(3.5) q[2]; Rz(0.25) q[2]; PhasedX(3.5, 0.5) q[2]; ZZPhase(0.5) q[6], - q[2]; PhasedX(0.5, 1) q[2]; Rz(3.5) q[6]; Rz(3.5) q[2]; Rz(0.25) q[6]; Rz(3.75) - q[2]; PhasedX(3.5, 0.5) q[6]; PhasedX(3.5, 0.5) q[2]; ZZPhase(0.5) q[1], q[2]; Rz(3.5) - q[1]; PhasedX(0.5, 1) q[2]; ZZPhase(0.5) q[1], q[6]; Rz(3.5) q[2]; Rz(3.5) q[1]; - Rz(0.25) q[2]; PhasedX(0.5, 1) q[6]; Rz(0.25) q[1]; PhasedX(0.5, 1.5) q[2]; Rz(3.5) - q[6]; Rz(1) q[2]; Rz(3.75) q[6]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0.5) q[6]; - ZZPhase(0.5) q[1], q[6]; ZZPhase(0.5) q[3], q[2]; Rz(3.5) q[1]; PhasedX(0.5, 1) - q[2]; Rz(3.5) q[3]; PhasedX(0.5, 1) q[6]; PhasedX(0.5, 1.5) q[1]; Rz(3.5) q[2]; - ZZPhase(0.5) q[3], q[7]; Rz(3.5) q[6]; Rz(1) q[1]; Rz(3.5) q[3]; PhasedX(1, 0) q[6]; - PhasedX(0.5, 1) q[7]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, 0.5) q[6]; Rz(3.5) q[7]; - Measure q[7] --> c[7]; ZZPhase(0.5) q[5], q[1]; PhasedX(0.5, 1) q[1]; Rz(3.5) q[5]; - Rz(3.5) q[1]; Rz(3.75) q[1]; PhasedX(3.5, 0.5) q[1]; ZZPhase(0.5) q[9], q[1]; PhasedX(0.5, - 1) q[1]; Rz(3.5) q[9]; Rz(3.5) q[1]; Rz(0.25) q[1]; PhasedX(3.5, 0.5) q[1]; ZZPhase(0.5) - q[5], q[1]; PhasedX(0.5, 1) q[1]; Rz(3.5) q[5]; Rz(3.5) q[1]; Rz(0.25) q[5]; Rz(3.75) - q[1]; PhasedX(3.5, 0.5) q[5]; PhasedX(3.5, 0.5) q[1]; ZZPhase(0.5) q[9], q[1]; PhasedX(0.5, - 1) q[1]; Rz(3.5) q[9]; Rz(3.5) q[1]; ZZPhase(0.5) q[9], q[5]; Rz(0.25) q[1]; PhasedX(0.5, - 1) q[5]; Rz(3.5) q[9]; PhasedX(0.5, 1.5) q[1]; Rz(3.5) q[5]; Rz(0.25) q[9]; Rz(1) - q[1]; Rz(3.75) q[5]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, 0.5) q[5]; ZZPhase(0.5) - q[2], q[1]; ZZPhase(0.5) q[9], q[5]; PhasedX(0.5, 1) q[1]; Rz(3.5) q[2]; PhasedX(0.5, - 1) q[5]; Rz(3.5) q[9]; Rz(3.5) q[1]; ZZPhase(0.5) q[2], q[6]; Rz(3.5) q[5]; PhasedX(0.5, - 1.5) q[9]; Rz(3.5) q[2]; PhasedX(1, 0) q[5]; PhasedX(0.5, 1) q[6]; Rz(1) q[9]; PhasedX(3.5, - 0.5) q[5]; Rz(3.5) q[6]; PhasedX(3.5, 0.5) q[9]; Measure q[6] --> c[6]; ZZPhase(0.5) - q[0], q[9]; Rz(3.5) q[0]; PhasedX(0.5, 1) q[9]; Rz(3.5) q[9]; Rz(3.75) q[9]; PhasedX(3.5, - 0.5) q[9]; ZZPhase(0.5) q[4], q[9]; Rz(3.5) q[4]; PhasedX(0.5, 1) q[9]; Rz(3.5) - q[9]; Rz(0.25) q[9]; PhasedX(3.5, 0.5) q[9]; ZZPhase(0.5) q[0], q[9]; Rz(3.5) q[0]; - PhasedX(0.5, 1) q[9]; Rz(0.25) q[0]; Rz(3.5) q[9]; PhasedX(3.5, 0.5) q[0]; Rz(3.75) - q[9]; PhasedX(3.5, 0.5) q[9]; ZZPhase(0.5) q[4], q[9]; Rz(3.5) q[4]; PhasedX(0.5, - 1) q[9]; ZZPhase(0.5) q[4], q[0]; Rz(3.5) q[9]; PhasedX(0.5, 1) q[0]; Rz(3.5) q[4]; - Rz(0.25) q[9]; Rz(3.5) q[0]; Rz(0.25) q[4]; PhasedX(0.5, 1.5) q[9]; Rz(3.75) q[0]; - Rz(1) q[9]; PhasedX(3.5, 0.5) q[0]; PhasedX(3.5, 0.5) q[9]; ZZPhase(0.5) q[4], q[0]; - ZZPhase(0.5) q[1], q[9]; PhasedX(0.5, 1) q[0]; Rz(3.5) q[1]; Rz(3.5) q[4]; PhasedX(0.5, - 1) q[9]; Rz(3.5) q[0]; ZZPhase(0.5) q[1], q[5]; PhasedX(3.5, 0.5) q[4]; Rz(3.5) - q[9]; ZZPhase(0.5) q[0], q[4]; Rz(3.5) q[1]; PhasedX(0.5, 1) q[5]; Rz(3.5) q[0]; - PhasedX(0.5, 1) q[4]; Rz(3.5) q[5]; Measure q[5] --> c[5]; Rz(3.5) q[4]; Measure - q[4] --> c[4]; ]' -sol: '[Reset q[0]; Reset q[1]; Reset q[2]; Reset q[3]; Reset q[4]; Reset q[5]; Reset - q[6]; Reset q[7]; Reset q[8]; Reset q[9]; PhasedX(1, 0) q[0]; PhasedX(1, 0) q[1]; - PhasedX(0.5, 0.5) q[2]; PhasedX(0.5, 0.5) q[3]; PhasedX(1, 0) q[4]; PhasedX(1, 0) - q[5]; PhasedX(1, 0) q[7]; PhasedX(0.5, 0.5) q[0]; PhasedX(0.5, 0.5) q[1]; PhasedXX(0.5,0.0) - q[2], q[6]; PhasedXX(0.5,0.0) q[3], q[7]; PhasedX(0.5, 0.5) q[4]; PhasedXX(0.5,0.0) - q[1], q[5]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0.5) q[3]; PhasedX(3.5, 0) q[6]; - PhasedX(3.5, 0) q[7]; PhasedX(3.5, 0.5) q[1]; Rz(3.5) q[2]; Rz(3.5) q[3]; PhasedX(3.5, - 0) q[5]; PhasedX(0.5, 0.5) q[6]; PhasedX(0.5, 0.5) q[7]; Rz(3.5) q[1]; PhasedX(0.5, - 0.5) q[2]; PhasedX(0.5, 0.5) q[3]; PhasedX(0.5, 0.5) q[5]; PhasedX(0.5, 0.5) q[1]; - PhasedXX(0.5,0.0) q[1], q[9]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, 0) q[9]; Rz(3.5) - q[1]; PhasedX(0.5, 1.5) q[9]; PhasedXX(0.5,0.0) q[2], q[1]; Rz(1) q[9]; PhasedXX(0.5,0.0) - q[0], q[9]; PhasedX(3.5, 0) q[1]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0.5) q[0]; - PhasedX(0.5, 1.5) q[1]; Rz(3.5) q[2]; PhasedX(3.5, 0) q[9]; Rz(3.5) q[0]; Rz(1) - q[1]; PhasedXX(0.5,0.0) q[3], q[2]; Rz(3.75) q[9]; PhasedX(0.5, 0.5) q[0]; PhasedXX(0.5,0.0) - q[5], q[1]; PhasedX(3.5, 0) q[2]; PhasedX(3.5, 0.5) q[3]; PhasedXX(0.5,0.0) q[4], - q[9]; PhasedX(3.5, 0) q[1]; PhasedX(0.5, 1.5) q[2]; Rz(3.5) q[3]; PhasedX(3.5, 0.5) - q[4]; PhasedX(3.5, 0.5) q[5]; PhasedX(3.5, 0) q[9]; Rz(3.75) q[1]; Rz(1) q[2]; PhasedX(0.5, - 0.5) q[3]; Rz(3.5) q[4]; Rz(3.5) q[5]; Rz(0.25) q[9]; PhasedXX(0.5,0.0) q[0], q[9]; - PhasedXX(0.5,0.0) q[6], q[2]; PhasedXX(0.5,0.0) q[3], q[8]; PhasedX(0.5, 0.5) q[4]; - PhasedX(0.5, 0.5) q[5]; PhasedX(3.5, 0.5) q[0]; PhasedX(3.5, 0) q[2]; PhasedX(3.5, - 0.5) q[3]; PhasedX(3.5, 0.5) q[6]; PhasedX(3.5, 0) q[8]; PhasedX(3.5, 0) q[9]; Rz(3.5) - q[0]; Rz(3.75) q[2]; Rz(3.5) q[3]; Rz(3.5) q[6]; PhasedX(0.5, 1.5) q[8]; Rz(3.75) - q[9]; Rz(0.25) q[0]; PhasedX(0.5, 0.5) q[3]; PhasedXX(0.5,0.0) q[4], q[9]; PhasedX(0.5, - 0.5) q[6]; Rz(1) q[8]; PhasedX(3.5, 0.5) q[4]; PhasedXX(0.5,0.0) q[7], q[8]; PhasedX(3.5, - 0) q[9]; Rz(3.5) q[4]; PhasedX(3.5, 0.5) q[7]; PhasedX(3.5, 0) q[8]; Rz(0.25) q[9]; - PhasedX(0.5, 0.5) q[4]; Rz(3.5) q[7]; Rz(3.75) q[8]; PhasedX(0.5, 1.5) q[9]; PhasedXX(0.5,0.0) - q[4], q[0]; PhasedX(0.5, 0.5) q[7]; Rz(1) q[9]; PhasedX(3.5, 0) q[0]; PhasedX(3.5, - 0.5) q[4]; PhasedX(0.5, 0.5) q[9]; Rz(3.75) q[0]; PhasedXX(0.5,0.0) q[9], q[1]; - Rz(3.5) q[4]; PhasedX(3.5, 0) q[1]; Rz(0.25) q[4]; PhasedX(3.5, 0.5) q[9]; Rz(0.25) - q[1]; PhasedX(0.5, 0.5) q[4]; Rz(3.5) q[9]; PhasedXX(0.5,0.0) q[4], q[0]; PhasedXX(0.5,0.0) - q[5], q[1]; PhasedX(0.5, 0.5) q[9]; PhasedX(3.5, 0) q[0]; PhasedX(3.5, 0) q[1]; - PhasedX(3.5, 0.5) q[4]; PhasedX(3.5, 0.5) q[5]; PhasedX(0.5, 0.5) q[0]; Rz(3.75) - q[1]; Rz(3.5) q[4]; Rz(3.5) q[5]; PhasedXX(0.5,0.0) q[9], q[1]; PhasedX(0.5, 0.5) - q[4]; Rz(0.25) q[5]; PhasedX(3.5, 0) q[1]; PhasedX(3.5, 0.5) q[9]; Rz(0.25) q[1]; - Rz(3.5) q[9]; PhasedX(0.5, 1.5) q[1]; PhasedX(0.5, 0.5) q[9]; Rz(1) q[1]; PhasedXX(0.5,0.0) - q[9], q[5]; PhasedX(0.5, 0.5) q[1]; PhasedX(3.5, 0) q[5]; PhasedX(3.5, 0.5) q[9]; - PhasedXX(0.5,0.0) q[1], q[2]; Rz(3.75) q[5]; Rz(3.5) q[9]; PhasedX(3.5, 0.5) q[1]; - PhasedX(3.5, 0) q[2]; Rz(0.25) q[9]; Rz(3.5) q[1]; Rz(0.25) q[2]; PhasedX(0.5, 0.5) - q[9]; PhasedX(0.5, 0.5) q[1]; PhasedXX(0.5,0.0) q[6], q[2]; PhasedXX(0.5,0.0) q[9], - q[5]; PhasedX(3.5, 0) q[2]; PhasedX(3.5, 0) q[5]; PhasedX(3.5, 0.5) q[6]; PhasedX(3.5, - 0.5) q[9]; Rz(3.75) q[2]; PhasedX(1, 0) q[5]; Rz(3.5) q[6]; Rz(3.5) q[9]; PhasedXX(0.5,0.0) - q[1], q[2]; Rz(0.25) q[6]; PhasedX(0.5, 0.5) q[9]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, - 0) q[2]; PhasedXX(0.5,0.0) q[9], q[5]; Rz(3.5) q[1]; Rz(0.25) q[2]; PhasedX(3.5, - 0) q[5]; PhasedX(3.5, 0.5) q[9]; PhasedX(0.5, 0.5) q[1]; PhasedX(0.5, 1.5) q[2]; - PhasedX(0.5, 0.5) q[5]; Rz(3.5) q[9]; PhasedXX(0.5,0.0) q[1], q[6]; Rz(1) q[2]; - PhasedX(0.5, 0.5) q[9]; PhasedX(3.5, 0.5) q[1]; PhasedX(0.5, 0.5) q[2]; PhasedX(3.5, - 0) q[6]; Rz(3.5) q[1]; PhasedXX(0.5,0.0) q[2], q[8]; Rz(3.75) q[6]; Rz(0.25) q[1]; - PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0) q[8]; PhasedX(0.5, 0.5) q[1]; Rz(3.5) q[2]; - Rz(0.25) q[8]; PhasedXX(0.5,0.0) q[1], q[6]; PhasedX(0.5, 0.5) q[2]; PhasedXX(0.5,0.0) - q[7], q[8]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, 0) q[6]; PhasedX(3.5, 0.5) q[7]; - PhasedX(3.5, 0) q[8]; Rz(3.5) q[1]; PhasedX(1, 0) q[6]; Rz(3.5) q[7]; Rz(3.75) q[8]; - PhasedX(0.5, 0.5) q[1]; PhasedXX(0.5,0.0) q[2], q[8]; Rz(0.25) q[7]; PhasedXX(0.5,0.0) - q[1], q[6]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0) q[8]; PhasedX(3.5, 0.5) q[1]; - Rz(3.5) q[2]; PhasedX(3.5, 0) q[6]; Rz(0.25) q[8]; Rz(3.5) q[1]; PhasedX(0.5, 0.5) - q[2]; PhasedX(0.5, 0.5) q[6]; PhasedX(0.5, 1.5) q[8]; PhasedX(0.5, 0.5) q[1]; PhasedXX(0.5,0.0) - q[2], q[7]; Rz(1) q[8]; Measure q[8] --> c[8]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, - 0) q[7]; Rz(3.5) q[2]; Rz(3.75) q[7]; Rz(0.25) q[2]; PhasedX(0.5, 0.5) q[2]; PhasedXX(0.5,0.0) - q[2], q[7]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0) q[7]; Rz(3.5) q[2]; PhasedX(0.5, - 0.5) q[2]; PhasedXX(0.5,0.0) q[2], q[7]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0) - q[7]; Rz(3.5) q[2]; PhasedX(0.5, 1.5) q[2]; Rz(1) q[2]; PhasedXX(0.5,0.0) q[6], - q[2]; PhasedX(3.5, 0) q[2]; PhasedX(3.5, 0.5) q[6]; Rz(3.75) q[2]; Rz(3.5) q[6]; - PhasedXX(0.5,0.0) q[1], q[2]; PhasedX(0.5, 0.5) q[6]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, - 0) q[2]; Rz(3.5) q[1]; Rz(0.25) q[2]; PhasedX(0.5, 0.5) q[1]; PhasedXX(0.5,0.0) - q[6], q[2]; PhasedX(3.5, 0) q[2]; PhasedX(3.5, 0.5) q[6]; Rz(3.75) q[2]; Rz(3.5) - q[6]; PhasedXX(0.5,0.0) q[1], q[2]; Rz(0.25) q[6]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, - 0) q[2]; Rz(3.5) q[1]; Rz(0.25) q[2]; PhasedX(0.5, 0.5) q[1]; PhasedX(0.5, 1.5) - q[2]; PhasedXX(0.5,0.0) q[1], q[6]; Rz(1) q[2]; PhasedX(3.5, 0.5) q[1]; PhasedXX(0.5,0.0) - q[3], q[2]; PhasedX(3.5, 0) q[6]; Rz(3.5) q[1]; PhasedX(3.5, 0) q[2]; PhasedX(3.5, - 0.5) q[3]; Rz(3.75) q[6]; Rz(0.25) q[1]; PhasedX(0.5, 0.5) q[2]; Rz(3.5) q[3]; PhasedX(0.5, - 0.5) q[1]; PhasedX(0.5, 0.5) q[3]; PhasedXX(0.5,0.0) q[1], q[6]; PhasedXX(0.5,0.0) - q[3], q[7]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, 0.5) q[3]; PhasedX(3.5, 0) q[6]; - PhasedX(3.5, 0) q[7]; Measure q[7] --> c[7]; Rz(3.5) q[1]; Rz(3.5) q[3]; PhasedX(1, - 0) q[6]; PhasedX(0.5, 1.5) q[1]; Rz(1) q[1]; PhasedXX(0.5,0.0) q[5], q[1]; PhasedX(3.5, - 0) q[1]; PhasedX(3.5, 0.5) q[5]; Rz(3.75) q[1]; Rz(3.5) q[5]; PhasedXX(0.5,0.0) - q[9], q[1]; PhasedX(0.5, 0.5) q[5]; PhasedX(3.5, 0) q[1]; PhasedX(3.5, 0.5) q[9]; - Rz(0.25) q[1]; Rz(3.5) q[9]; PhasedXX(0.5,0.0) q[5], q[1]; PhasedX(0.5, 0.5) q[9]; - PhasedX(3.5, 0) q[1]; PhasedX(3.5, 0.5) q[5]; Rz(3.75) q[1]; Rz(3.5) q[5]; PhasedXX(0.5,0.0) - q[9], q[1]; Rz(0.25) q[5]; PhasedX(3.5, 0) q[1]; PhasedX(3.5, 0.5) q[9]; Rz(0.25) - q[1]; Rz(3.5) q[9]; PhasedX(0.5, 1.5) q[1]; PhasedX(0.5, 0.5) q[9]; Rz(1) q[1]; - PhasedXX(0.5,0.0) q[9], q[5]; PhasedXX(0.5,0.0) q[2], q[1]; PhasedX(3.5, 0) q[5]; - PhasedX(3.5, 0.5) q[9]; PhasedX(3.5, 0) q[1]; PhasedX(3.5, 0.5) q[2]; Rz(3.75) q[5]; - Rz(3.5) q[9]; PhasedX(0.5, 0.5) q[1]; Rz(3.5) q[2]; Rz(0.25) q[9]; PhasedX(0.5, - 0.5) q[2]; PhasedX(0.5, 0.5) q[9]; PhasedXX(0.5,0.0) q[2], q[6]; PhasedXX(0.5,0.0) - q[9], q[5]; PhasedX(3.5, 0.5) q[2]; PhasedX(3.5, 0) q[5]; PhasedX(3.5, 0) q[6]; - PhasedX(3.5, 0.5) q[9]; Measure q[6] --> c[6]; Rz(3.5) q[2]; PhasedX(1, 0) q[5]; - Rz(3.5) q[9]; PhasedX(0.5, 1.5) q[9]; Rz(1) q[9]; PhasedXX(0.5,0.0) q[0], q[9]; - PhasedX(3.5, 0.5) q[0]; PhasedX(3.5, 0) q[9]; Rz(3.5) q[0]; Rz(3.75) q[9]; PhasedX(0.5, - 0.5) q[0]; PhasedXX(0.5,0.0) q[4], q[9]; PhasedX(3.5, 0.5) q[4]; PhasedX(3.5, 0) - q[9]; Rz(3.5) q[4]; Rz(0.25) q[9]; PhasedXX(0.5,0.0) q[0], q[9]; PhasedX(0.5, 0.5) - q[4]; PhasedX(3.5, 0.5) q[0]; PhasedX(3.5, 0) q[9]; Rz(3.5) q[0]; Rz(3.75) q[9]; - Rz(0.25) q[0]; PhasedXX(0.5,0.0) q[4], q[9]; PhasedX(3.5, 0.5) q[4]; PhasedX(3.5, - 0) q[9]; Rz(3.5) q[4]; Rz(0.25) q[9]; PhasedX(0.5, 0.5) q[4]; PhasedX(0.5, 1.5) - q[9]; PhasedXX(0.5,0.0) q[4], q[0]; Rz(1) q[9]; PhasedX(3.5, 0) q[0]; PhasedXX(0.5,0.0) - q[1], q[9]; PhasedX(3.5, 0.5) q[4]; Rz(3.75) q[0]; PhasedX(3.5, 0.5) q[1]; Rz(3.5) - q[4]; PhasedX(3.5, 0) q[9]; Rz(3.5) q[1]; Rz(0.25) q[4]; PhasedX(0.5, 0.5) q[1]; - PhasedX(0.5, 0.5) q[4]; PhasedXX(0.5,0.0) q[4], q[0]; PhasedXX(0.5,0.0) q[1], q[5]; - PhasedX(3.5, 0) q[0]; PhasedX(3.5, 0.5) q[1]; PhasedX(3.5, 0.5) q[4]; PhasedX(3.5, - 0) q[5]; Measure q[5] --> c[5]; PhasedX(0.5, 0.5) q[0]; Rz(3.5) q[1]; Rz(3.5) q[4]; - PhasedXX(0.5,0.0) q[0], q[4]; PhasedX(3.5, 0.5) q[0]; PhasedX(3.5, 0) q[4]; Measure - q[4] --> c[4]; Rz(3.5) q[0]; ]' diff --git a/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/simple_events.json b/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/simple_events.json index cc2cced8..98118e87 100644 --- a/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/simple_events.json +++ b/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/simple_events.json @@ -442,7 +442,7 @@ "source": "Source.USER", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -459,7 +459,7 @@ "source": "Source.OPTIMISER", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -468,7 +468,7 @@ "source": "Source.ERROR_MODEL", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -477,7 +477,7 @@ "source": "Source.SIMULATOR", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": -1.5707963267948966, "duration_ns": 0 @@ -487,7 +487,7 @@ "source": "Source.USER", "operation": { "op": "Rz", - "qubit": 0, + "qubit": 1, "theta": 3.141592653589793 } }, @@ -503,7 +503,7 @@ "source": "Source.OPTIMISER", "operation": { "op": "Rz", - "qubit": 0, + "qubit": 1, "theta": 3.141592653589793 } }, @@ -511,7 +511,7 @@ "source": "Source.ERROR_MODEL", "operation": { "op": "Rz", - "qubit": 0, + "qubit": 1, "theta": 3.141592653589793 } }, @@ -519,7 +519,7 @@ "source": "Source.SIMULATOR", "operation": { "op": "Rz", - "qubit": 0, + "qubit": 1, "theta": 3.141592653589793, "duration_ns": 0 } @@ -528,7 +528,7 @@ "source": "Source.USER", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -545,7 +545,7 @@ "source": "Source.OPTIMISER", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -554,7 +554,7 @@ "source": "Source.ERROR_MODEL", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -563,7 +563,7 @@ "source": "Source.SIMULATOR", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": -1.5707963267948966, "duration_ns": 0 @@ -573,7 +573,7 @@ "source": "Source.USER", "operation": { "op": "Rz", - "qubit": 1, + "qubit": 0, "theta": 3.141592653589793 } }, @@ -589,7 +589,7 @@ "source": "Source.OPTIMISER", "operation": { "op": "Rz", - "qubit": 1, + "qubit": 0, "theta": 3.141592653589793 } }, @@ -597,7 +597,7 @@ "source": "Source.ERROR_MODEL", "operation": { "op": "Rz", - "qubit": 1, + "qubit": 0, "theta": 3.141592653589793 } }, @@ -605,7 +605,7 @@ "source": "Source.SIMULATOR", "operation": { "op": "Rz", - "qubit": 1, + "qubit": 0, "theta": 3.141592653589793, "duration_ns": 0 } diff --git a/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/soft_events.json b/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/soft_events.json index a2b11dce..0ab4542d 100644 --- a/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/soft_events.json +++ b/selene-sim/python/tests/snapshots/test_runtimes/test_simple_vs_softrz/soft_events.json @@ -106,7 +106,7 @@ "source": "Source.USER", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -115,7 +115,7 @@ "source": "Source.USER", "operation": { "op": "Rz", - "qubit": 0, + "qubit": 1, "theta": 3.141592653589793 } }, @@ -123,7 +123,7 @@ "source": "Source.USER", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": -1.5707963267948966 } @@ -132,7 +132,7 @@ "source": "Source.USER", "operation": { "op": "Rz", - "qubit": 1, + "qubit": 0, "theta": 3.141592653589793 } }, @@ -553,7 +553,7 @@ "source": "Source.OPTIMISER", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": 0.0 } @@ -562,7 +562,7 @@ "source": "Source.ERROR_MODEL", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": 0.0 } @@ -571,7 +571,7 @@ "source": "Source.SIMULATOR", "operation": { "op": "Rxy", - "qubit": 0, + "qubit": 1, "theta": 1.5707963267948966, "phi": 0.0, "duration_ns": 0 @@ -589,7 +589,7 @@ "source": "Source.OPTIMISER", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": 0.0 } @@ -598,7 +598,7 @@ "source": "Source.ERROR_MODEL", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": 0.0 } @@ -607,7 +607,7 @@ "source": "Source.SIMULATOR", "operation": { "op": "Rxy", - "qubit": 1, + "qubit": 0, "theta": 1.5707963267948966, "phi": 0.0, "duration_ns": 0 diff --git a/selene-sim/python/tests/test_backtrace.py b/selene-sim/python/tests/test_backtrace.py new file mode 100644 index 00000000..ba084d31 --- /dev/null +++ b/selene-sim/python/tests/test_backtrace.py @@ -0,0 +1,302 @@ +import pytest +import subprocess +from pathlib import Path +from hugr.qsystem.result import QsysResult +from selene_sim import Quest, Stim +from selene_sim.build import build +from selene_sim.exceptions import SelenePanicError +from selene_sim.result_handling.parse_shot import postprocess_unparsed_stream +from selene_sim import stack_trace as stack_trace_module + + +def test_windows_symbolizer_uses_relative_addresses(monkeypatch): + recorded_command = None + + def fake_run(command, **_kwargs): + nonlocal recorded_command + recorded_command = command + return subprocess.CompletedProcess(command, 0, stdout="[]", stderr="") + + monkeypatch.setattr(stack_trace_module.platform, "system", lambda: "Windows") + monkeypatch.setattr(stack_trace_module, "run", fake_run) + + assert stack_trace_module.run_llvm_symbolizer(Path("program.exe"), [0x123]) == ( + [], + None, + ) + assert recorded_command is not None + assert recorded_command[0].endswith("llvm-symbolizer.exe") + assert "--relative-address" in recorded_command + assert recorded_command[-1] == "0x123" + + +def test_dsym_is_created_while_symbolizing(monkeypatch): + recorded_commands = [] + + def fake_run(command, **_kwargs): + recorded_commands.append(command) + if str(command[0]).endswith("dsymutil"): + return subprocess.CompletedProcess(command, 0, stdout=b"", stderr=b"") + return subprocess.CompletedProcess( + command, 0, stdout='[{"Symbol": []}]', stderr="" + ) + + monkeypatch.setattr(stack_trace_module.platform, "system", lambda: "Darwin") + monkeypatch.setattr(stack_trace_module, "run", fake_run) + + stack_trace = stack_trace_module.StackTrace() + stack_trace.add_entry(Path("program.selene.x"), 0x123) + stack_trace.symbolize(Path("program.selene.x")) + + assert recorded_commands[0][-3:] == [ + "-o", + "program.selene.x.dSYM", + "program.selene.x", + ] + assert "--dsym-hint=program.selene.x.dSYM" in recorded_commands[1] + assert stack_trace.symbolization_failure is None + + +def test_dsym_failure_does_not_raise(monkeypatch): + def fake_run(command, **_kwargs): + if str(command[0]).endswith("dsymutil"): + raise subprocess.CalledProcessError(1, command) + return subprocess.CompletedProcess( + command, 0, stdout='[{"Symbol": []}]', stderr="" + ) + + monkeypatch.setattr(stack_trace_module.platform, "system", lambda: "Darwin") + monkeypatch.setattr(stack_trace_module, "run", fake_run) + + stack_trace = stack_trace_module.StackTrace() + stack_trace.add_entry(Path("program.selene.x"), 0x123) + stack_trace.symbolize(Path("program.selene.x")) + + assert stack_trace.symbolization_failure == "creating macOS debug symbols" + + +def test_backtrace_always_panic(compiled_guppy): + """ + This test verifies the behaviour of panic(), which should stop the shot + and should not allow any further shots to be performed. On the python + client side, this should result in an Exception rather than being added + into the results. + """ + + # note: to preserve line numbers and columns, this is stripped + # and dedent is avoided. + guppy_source = """ +from guppylang.decorator import guppy +from guppylang.std.builtins import result, panic +from guppylang.std.quantum import qubit, h, measure + +@guppy +def always_panic() -> None: + panic("This should always panic") +# ^ that's line 7, column 4 + +@guppy +def main() -> None: + always_panic() +""".strip() + + llvm_file = compiled_guppy( + program_name="panic", + guppy_source=guppy_source, + emit_debug=True, + ) + + runner = build(llvm_file) + with pytest.raises( + SelenePanicError, match="This should always panic" + ) as exception_info: + shots = QsysResult( + runner.run_shots( + Quest(), + n_qubits=1, + n_shots=100, + random_seed=0, + ) + ) + the_exception = exception_info.value + # note: in pytests, we store the guppy in a file and sanitize + # debug info point to /sanitized/path/program.py + assert "Stack trace:" in str(the_exception) + stack_trace = the_exception.stack_trace + assert len(stack_trace.entries) > 0 + filtered_trace = [entry for entry in stack_trace.entries if entry.symbols] + assert len(filtered_trace) == 1 + entry = filtered_trace[0] + assert entry.symbols[0].line == 7 + assert entry.symbols[0].column == 4 + # At the time of writing, the actual function that calls + # panic isn't preserved because of optimisations on the hugr. + assert entry.symbols[0].function_name == "main" + + _, unparsed_error = postprocess_unparsed_stream( + runner.run_shots( + Quest(), + n_qubits=1, + n_shots=1, + random_seed=0, + parse_results=False, + ) + ) + assert isinstance(unparsed_error, SelenePanicError) + assert unparsed_error.stack_trace is not None + unparsed_symbols = [ + entry for entry in unparsed_error.stack_trace.entries if entry.symbols + ] + assert len(unparsed_symbols) == 1 + assert unparsed_symbols[0].symbols[0].function_name == "main" + assert unparsed_symbols[0].symbols[0].line == 7 + assert unparsed_symbols[0].symbols[0].column == 4 + # this is because the output LLVM looks like: + # ``` + # ; Function Attrs: noreturn + # define noundef i64 @qmain(i64 %0) local_unnamed_addr #0 !dbg !9 { + # entry: + # tail call void @setup(i64 %0), !dbg !14 + # tail call void @panic(i32 1001, ptr nonnull @"s_This shoul.4464F519.0"), !dbg !15 + # unreachable + # } + # ``` + # in particular, note how always_panic isn't in the output LLVM, so it's not + # preserved in the stack trace. + # + # if this is every changed, run pytest --compile-guppy and change + # this test to assert the function_name is "always_panic". + + +def test_backtrace_sometimes_panic(compiled_guppy): + """ + This test verifies the behaviour of panic(), which should stop the shot + and should not allow any further shots to be performed. On the python + client side, this should result in an Exception rather than being added + into the results. + """ + + # note: to preserve line numbers and columns, this is stripped + # and dedent is avoided. + guppy_source = """ +from guppylang.decorator import guppy +from guppylang.std.builtins import result, panic, owned +from guppylang.std.quantum import qubit, h, measure + +@guppy +def maybe_panic(q: qubit @owned) -> None: + if measure(q).read(): + panic("The bad event has been triggered") +# ^ that's line 8, column 8 + +@guppy +def main() -> None: + q = qubit() + h(q) + maybe_panic(q) +""".strip() + + llvm_file = compiled_guppy( + program_name="panic", + guppy_source=guppy_source, + emit_debug=True, + ) + + runner = build(llvm_file) + with pytest.raises( + SelenePanicError, match="The bad event has been triggered" + ) as exception_info: + shots = QsysResult( + runner.run_shots( + Quest(), + n_qubits=1, + n_shots=100, + random_seed=0, + ) + ) + the_exception = exception_info.value + # note: in pytests, we store the guppy in a file and sanitize + # debug info point to /sanitized/path/program.py + assert "Stack trace:" in str(the_exception) + stack_trace = the_exception.stack_trace + filtered_trace = [entry for entry in stack_trace.entries if entry.symbols] + assert len(filtered_trace) == 1 + entry = filtered_trace[0] + assert entry.symbols[0].line == 8 + assert entry.symbols[0].column == 8 + # as in the previous test, optimisations mean that the function name + # isn't preserved. + assert entry.symbols[0].function_name == "main" + + +def test_backtrace_qalloc(compiled_guppy): + """ + This test verifies the behaviour of panic() when it is called as a result + of a failed qalloc. On the python client side, this should result in an + Exception rather than being added into the results. + """ + + # note: to preserve line numbers and columns, this is stripped + # and dedent is avoided. + guppy_source = """ +from guppylang.decorator import guppy +from guppylang.std.builtins import result +from guppylang.std.quantum import qubit, cx, measure, h + +@guppy +def recursive_cx(source: qubit, n: int) -> None: + q = qubit() + # ^ line 7, column 8 + cx(source, q) + if n > 0: + recursive_cx(q, n - 1) + # ^ line 11, column 8 + result("q", measure(q).read()) + +@guppy +def prep(q: qubit) -> None: + h(q) + +@guppy +def main() -> None: + q = qubit() + prep(q) + recursive_cx(q, 1000) + # ^ line 23, column 4 + result("q", measure(q).read()) +""".strip() + + llvm_file = compiled_guppy( + program_name="panic", + guppy_source=guppy_source, + emit_debug=True, + ) + + runner = build(llvm_file) + with pytest.raises( + SelenePanicError, match="No more qubits available to allocate" + ) as exception_info: + shots = QsysResult( + runner.run_shots( + Stim(), + n_qubits=500, + n_shots=10, + random_seed=0, + ) + ) + the_exception = exception_info.value + assert "Stack trace:" in str(the_exception) + filtered_trace = [ + entry for entry in the_exception.stack_trace.entries if entry.symbols + ] + assert len(filtered_trace) == 501 + assert filtered_trace[0].symbols[0].line == 7 + assert filtered_trace[0].symbols[0].column == 8 + assert filtered_trace[0].symbols[0].function_name == "recursive_cx" + for i in range(1, 500): + assert filtered_trace[i].symbols[0].line == 11 + assert filtered_trace[i].symbols[0].column == 8 + assert filtered_trace[i].symbols[0].function_name == "recursive_cx" + assert filtered_trace[500].symbols[0].line == 23 + assert filtered_trace[500].symbols[0].column == 4 + assert filtered_trace[500].symbols[0].function_name == "main" diff --git a/selene-sim/python/tests/test_exceptions.py b/selene-sim/python/tests/test_exceptions.py index 7f964b75..90a18c06 100644 --- a/selene-sim/python/tests/test_exceptions.py +++ b/selene-sim/python/tests/test_exceptions.py @@ -1,4 +1,6 @@ import pickle +from pathlib import Path + import pytest from selene_sim.exceptions import ( @@ -7,6 +9,69 @@ SeleneRuntimeError, SelenePanicError, ) +from selene_sim.result_handling.exception_encoding import ( + encode_exception, + extract_exception_from_results, +) +from selene_sim.stack_trace import StackTrace, Symbol + + +def test_exception_reports_stack_trace_not_symbolized(): + stack_trace = StackTrace() + stack_trace.add_entry(Path("program"), 0x123) + + message = str(SeleneRuntimeError("Exception", stack_trace=stack_trace)) + + assert message == ( + "Exception\nStack trace addresses were captured, but symbolization was not " + "attempted." + ) + + +def test_exception_reports_stack_trace_symbolization_failure(): + stack_trace = StackTrace(symbolization_failure="running llvm-symbolizer") + stack_trace.add_entry(Path("program"), 0x123) + + message = str(SeleneRuntimeError("Exception", stack_trace=stack_trace)) + + assert message == ( + "Exception\nAn attempt was made to establish the stack trace, but it failed " + "while running llvm-symbolizer." + ) + + +def test_exception_encoding_preserves_symbolized_stack_trace(tmp_path): + stdout = tmp_path / "stdout.txt" + stderr = tmp_path / "stderr.txt" + stdout.write_text("") + stderr.write_text("") + + stack_trace = StackTrace( + symbolization_attempted=True, + symbolization_failure="creating macOS debug symbols", + ) + stack_trace.add_entry(Path("program"), 0x123) + stack_trace.entries[0].symbols.append( + Symbol( + column=4, + line=7, + filename="program.py", + function_name="main", + ) + ) + error = SelenePanicError("panic", 1001) + + encoded = list(encode_exception(error, stdout, stderr, stack_trace)) + trace_metadata_tags = [tag for tag, _ in encoded if tag.startswith("_TRACE_")] + assert all("{" not in tag and "}" not in tag for tag in trace_metadata_tags) + results, decoded = extract_exception_from_results(encoded) + + assert results == [] + assert isinstance(decoded, SelenePanicError) + assert decoded.stack_trace is not None + assert decoded.stack_trace.symbolization_attempted + assert decoded.stack_trace.symbolization_failure == "creating macOS debug symbols" + assert decoded.stack_trace.entries == stack_trace.entries @pytest.mark.parametrize( diff --git a/selene-sim/python/tests/test_guppy.py b/selene-sim/python/tests/test_guppy.py index 8fafbc92..5f796237 100644 --- a/selene-sim/python/tests/test_guppy.py +++ b/selene-sim/python/tests/test_guppy.py @@ -543,14 +543,25 @@ def main() -> None: ) runner = build(llvm_file) + metric_store = MetricStore() with pytest.raises(SelenePanicError, match="not representable") as exception_info: shots = QsysResult( runner.run_shots( - Stim(), n_qubits=3, n_shots=10, timeout=datetime.timedelta(seconds=1) + Stim(), + n_qubits=3, + n_shots=10, + event_hook=metric_store, + timeout=datetime.timedelta(seconds=1), ) ) + # Panic records precede shot-end metadata in the result stream. The frontend + # must drain the shot before raising so these metrics are not lost. + assert set(metric_store.shots[0]) == {"emulator", "post_runtime", "user_program"} + assert exception_info.value.stack_trace is not None + assert exception_info.value.stack_trace.entries + def test_corrupted_plugin(compiled_guppy): """ @@ -849,17 +860,17 @@ def main() -> None: runner = build(llvm_file) measlog = MeasurementExtractor() - got = list(runner.run(Quest(), verbose=True, n_qubits=4, event_hook=measlog)) + got = set(runner.run(Quest(), n_qubits=4, event_hook=measlog)) - expected_user = [("q2", 1), ("q3", 0)] - expected_meas_strs = [ + expected_user = {("q2", 1), ("q3", 0)} + expected_meas_strs = { "MEAS:INTARR:[0, 1]", "MEAS:INTARR:[1, 1]", "MEAS:INTARR:[2, 1]", "MEASLEAKED:INTARR:[3, 0]", - ] + } assert got == expected_user - assert [str(entry) for entry in measlog.log_entries[0]] == expected_meas_strs + assert {str(entry) for entry in measlog.log_entries[0]} == expected_meas_strs def test_measurement_output_multishot(compiled_guppy): @@ -905,21 +916,19 @@ def main() -> None: runner = build(llvm_file) measlog = MeasurementExtractor() - shots = runner.run_shots( - Quest(), verbose=True, n_qubits=4, n_shots=10, event_hook=measlog - ) + shots = runner.run_shots(Quest(), n_qubits=4, n_shots=10, event_hook=measlog) - expected_user = [("q2", 1), ("q3", 0)] - expected_meas_strs = [ + expected_user = {("q2", 1), ("q3", 0)} + expected_meas_strs = { "MEAS:INTARR:[0, 1]", "MEAS:INTARR:[1, 1]", "MEAS:INTARR:[2, 1]", "MEASLEAKED:INTARR:[3, 0]", - ] + } for shot_user in shots: - assert list(shot_user) == expected_user + assert set(shot_user) == expected_user for shot_meas in measlog: - assert [str(entry) for entry in shot_meas] == expected_meas_strs + assert {str(entry) for entry in shot_meas} == expected_meas_strs def test_cy(compiled_guppy): diff --git a/selene-sim/python/tests/test_debug.py b/selene-sim/python/tests/test_quantum_state.py similarity index 100% rename from selene-sim/python/tests/test_debug.py rename to selene-sim/python/tests/test_quantum_state.py diff --git a/selene-sim/python/tests/test_unparsed.py b/selene-sim/python/tests/test_unparsed.py index dae226fc..213f8416 100644 --- a/selene-sim/python/tests/test_unparsed.py +++ b/selene-sim/python/tests/test_unparsed.py @@ -302,6 +302,9 @@ def main() -> None: assert isinstance(error, SelenePanicError) assert error.code == 1001 assert error.message == "Postselection failed" + assert error.stack_trace is not None + assert error.stack_trace.entries + assert error.stack_trace.symbolization_attempted assert len(shots) == 3 assert shots[0] == [("USER:BOOL:c", 0)] diff --git a/selene-sim/rust/backtrace.rs b/selene-sim/rust/backtrace.rs new file mode 100644 index 00000000..bceb6ea0 --- /dev/null +++ b/selene-sim/rust/backtrace.rs @@ -0,0 +1,174 @@ +use std::path::PathBuf; + +pub struct Module { + pub path: PathBuf, + /// The address format expected by llvm-symbolizer for this module. + /// + /// ELF and Mach-O addresses are object virtual addresses. Windows addresses are + /// relative virtual addresses and must be passed with `--relative-address`. + pub address: u64, +} + +#[cfg(unix)] +fn module_path(pc: u64) -> Option { + use std::ffi::{CStr, c_void}; + use std::os::unix::ffi::OsStrExt; + + unsafe { + let mut info: libc::Dl_info = std::mem::zeroed(); + if libc::dladdr(pc as *const c_void, &mut info) == 0 || info.dli_fname.is_null() { + return None; + } + + let path = CStr::from_ptr(info.dli_fname).to_bytes(); + Some(PathBuf::from(std::ffi::OsStr::from_bytes(path))) + } +} + +#[cfg(target_os = "linux")] +struct ProgramHeaderSearch { + pc: u64, + load_bias: Option, +} + +#[cfg(target_os = "linux")] +unsafe extern "C" fn find_elf_load_bias( + info: *mut libc::dl_phdr_info, + _size: libc::size_t, + data: *mut libc::c_void, +) -> libc::c_int { + let Some(info) = (unsafe { info.as_ref() }) else { + return 0; + }; + let Some(search) = (unsafe { data.cast::().as_mut() }) else { + return 0; + }; + if info.dlpi_phdr.is_null() { + return 0; + } + + let headers = + unsafe { std::slice::from_raw_parts(info.dlpi_phdr, usize::from(info.dlpi_phnum)) }; + let load_bias = info.dlpi_addr; + for header in headers { + if header.p_type != libc::PT_LOAD { + continue; + } + let Some(start) = load_bias.checked_add(header.p_vaddr) else { + continue; + }; + let Some(end) = start.checked_add(header.p_memsz) else { + continue; + }; + if (start..end).contains(&search.pc) { + search.load_bias = Some(load_bias); + return 1; + } + } + 0 +} + +#[cfg(target_os = "linux")] +impl Module { + pub fn from_program_counter(pc: u64) -> Option { + let path = module_path(pc)?; + let mut search = ProgramHeaderSearch { + pc, + load_bias: None, + }; + unsafe { + libc::dl_iterate_phdr( + Some(find_elf_load_bias), + std::ptr::from_mut(&mut search).cast(), + ); + } + let address = pc.checked_sub(search.load_bias?)?; + Some(Self { path, address }) + } +} + +#[cfg(target_os = "macos")] +#[allow(deprecated)] +impl Module { + pub fn from_program_counter(pc: u64) -> Option { + use std::ffi::c_void; + + let path = module_path(pc)?; + unsafe { + let mut info: libc::Dl_info = std::mem::zeroed(); + if libc::dladdr(pc as *const c_void, &mut info) == 0 || info.dli_fbase.is_null() { + return None; + } + + let image_header = info.dli_fbase.cast_const().cast::(); + for index in 0..libc::_dyld_image_count() { + if libc::_dyld_get_image_header(index) != image_header { + continue; + } + let slide = libc::_dyld_get_image_vmaddr_slide(index); + let address = if slide >= 0 { + pc.checked_sub(slide as u64)? + } else { + pc.checked_add(slide.unsigned_abs() as u64)? + }; + return Some(Self { path, address }); + } + } + None + } +} + +#[cfg(all(unix, not(any(target_os = "linux", target_os = "macos"))))] +impl Module { + pub fn from_program_counter(pc: u64) -> Option { + use std::ffi::c_void; + + let path = module_path(pc)?; + unsafe { + let mut info: libc::Dl_info = std::mem::zeroed(); + if libc::dladdr(pc as *const c_void, &mut info) == 0 || info.dli_fbase.is_null() { + return None; + } + let address = pc.checked_sub(info.dli_fbase as u64)?; + Some(Self { path, address }) + } + } +} + +#[cfg(windows)] +impl Module { + pub fn from_program_counter(pc: u64) -> Option { + use std::os::windows::ffi::OsStringExt; + use windows_sys::Win32::System::LibraryLoader::{ + GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + GetModuleFileNameW, GetModuleHandleExW, + }; + + unsafe { + let mut module = std::ptr::null_mut(); + + let flags = GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS + | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT; + + if GetModuleHandleExW(flags, pc as usize as *const u16, &mut module) == 0 { + return None; + } + + let base = module as usize as u64; + + let mut buffer = vec![0u16; 32_768]; + let len = GetModuleFileNameW(module, buffer.as_mut_ptr(), buffer.len() as u32); + + if len == 0 { + return None; + } + + buffer.truncate(len as usize); + + Some(Module { + path: PathBuf::from(std::ffi::OsString::from_wide(&buffer)), + address: pc.checked_sub(base)?, + }) + } + } +} diff --git a/selene-sim/rust/lib.rs b/selene-sim/rust/lib.rs index a01c75ed..79a50946 100644 --- a/selene-sim/rust/lib.rs +++ b/selene-sim/rust/lib.rs @@ -1,3 +1,4 @@ +pub mod backtrace; pub mod emulator; pub mod event_hooks; pub mod selene_instance; diff --git a/selene-sim/rust/selene_instance/print.rs b/selene-sim/rust/selene_instance/print.rs index 86b155eb..0593a5cd 100644 --- a/selene-sim/rust/selene_instance/print.rs +++ b/selene-sim/rust/selene_instance/print.rs @@ -1,3 +1,4 @@ +use super::super::backtrace::Module; use super::SeleneInstance; use anyhow::Result; use selene_core::encoder::{OutputStream, StreamWritable}; @@ -23,6 +24,29 @@ impl SeleneInstance { pub fn print(&mut self, tag: &str, value: T) -> Result<()> { print_directly_to_stream(&mut self.out_encoder, self.time_cursor, tag, value) } + fn emit_debug_trace(&mut self) -> Result<()> { + // Capture the backtrace at the point of the panic and include it in the output stream. + // This can be used by the frontend to provide more context about where a panic occurred, + // which is especially useful for panics originating from compiled user code, where the + // source of the panic may not be immediately obvious. + let mut status = Ok(()); + backtrace::trace(|frame| { + let ip = frame.ip() as u64; + if ip != 0 { + let pc = ip - 1; + let Some(module) = Module::from_program_counter(pc) else { + return true; + }; + let tag = format!("DEBUG:BACKTRACE:{}", module.path.display()); + if let Err(e) = self.print(&tag, module.address) { + status = Err(anyhow::anyhow!("Failed to emit debug trace: {:?}", e)); + return false; + } + } + true + }); + status + } pub fn print_panic(&mut self, message: &str, error_code: u32) -> Result<()> { // In some cases, e.g. the compiled user program, the exit namespace is already // encoded in the provided message. In others, e.g. runtime panics from components, @@ -32,7 +56,14 @@ impl SeleneInstance { } else { format!("EXIT:INT:{}", message) }; - self.print(&tag, error_code as u64) + self.print(&tag, error_code as u64)?; + + if error_code >= 1000 { + // The panic is already safely in the stream. A backtrace is supplementary + // and must not prevent the original panic from being reported. + let _ = self.emit_debug_trace(); + } + Ok(()) } pub fn print_exit(&mut self, message: &str, error_code: u32) -> Result<()> { // At present, we handle exits in the same way as panics - the code